Visualize type of the data with other summary statistics

I created a simple function to show the type of data for all the variables in a dataframe which I find to be useful before the data processing step:

def df_description(df):
    s = df.sort_index().describe(include='all').transpose()
    s['type'] = df.sort_index().dtypes
    display_all(s)
df_description(train_raw)

Hope this is useful if you want to deal with categorical data.

6 Likes

nice! thanks for sharing!