app/run.py
def multiclass_dist(df):
    '''This function calculates the distribution of multiclassed messages.
    
    If the input is invalid or the data does not exist, this function will raise an error.
    
    INPUT:
    df --> A Pandas DataFrame containing the prepared data
    
    OUTPUT:
    multiclass_msgs --> A Pandas DataFrame containing the total number of messages 
    for each total relevant categories
    '''
    
    categories = df.drop(['id', 'message', 'original', 'genre'], axis=1)
    categories['total_cat'] = categories.sum(axis=1)
    multi_cat_msgs = categories.groupby('total_cat').count()[['related']]
    multi_cat_msgs.columns = ['total']
    
    return multi_cat_msgs
This function calculates the distribution of multiclassed messages.
    
    If the input is invalid or the data does not exist, this function will raise an error.
    
    INPUT:
    df --> A Pandas DataFrame containing the prepared data
    
    OUTPUT:
    multiclass_msgs --> A Pandas DataFrame containing the total number of messages 
    for each total relevant categories
    
This function calculates the distribution of multiclassed messages.
If the input is invalid or the data does not exist, this function will raise an error.

-> A Pandas DataFrame containing the prepared data

-> A Pandas DataFrame containing the total number of messages
for each total relevant categories
This function calculates the distribution of multiclassed messages . If the input is invalid or the data does not exist this function will raise an error . - > A Pandas DataFrame containing the prepared data - > A Pandas DataFrame containing the total number of messages for each total relevant categories
def multiclass_dist(df):
    categories = df.drop(['id', 'message', 'original', 'genre'], axis=1)
    categories['total_cat'] = categories.sum(axis=1)
    multi_cat_msgs = categories.groupby('total_cat').count()[['related']]
    multi_cat_msgs.columns = ['total']
    return multi_cat_msgs
def multiclass_dist ( df ) : categories = df . drop ( [ 'id' , 'message' , 'original' , 'genre' ] , axis = 1 ) categories [ 'total_cat' ] = categories . sum ( axis = 1 ) multi_cat_msgs = categories . groupby ( 'total_cat' ) . count ( ) [ [ 'related' ] ] multi_cat_msgs . columns = [ 'total' ] return multi_cat_msgs
This function calculates the distribution of multiclassed messages.
This function calculates the distribution of multiclassed messages .
'''This function calculates the distribution of multiclassed messages.
    
    If the input is invalid or the data does not exist, this function will raise an error.
    
    INPUT:
    df --> A Pandas DataFrame containing the prepared data
    
    OUTPUT:
    multiclass_msgs --> A Pandas DataFrame containing the total number of messages 
    for each total relevant categories
    '''
df