jmquintana79
4/13/2018 - 5:49 AM

basic analysis df

Basic analysis of data stored into a df. df -- df of data. return -- df with the basic statistics.

from pandas import concat, DataFrame

## basic analysis of data stored into a df
def dfanalysis(df:'dataframe')->'dataframe':
    """
    Basic analysis of data stored into a df.
    df -- df of data.
    return -- df with the basic statistics.
    """
    return concat([df.describe().transpose(),
            DataFrame(df.isnull().sum(),columns=['nnull']),
            DataFrame(df.dtypes,columns=['dtypes'])],axis=1)