application_vnd.jupyter.stderr_output_1.png
import pandas as pd

train_set = pd.read_csv('train.csv')
test_set = pd.read_csv('test.csv')

def missing_zero_values_table(df):
    zero_val = (df == 0.0).astype(int).sum(axis=0)
    mis_val = df.isnull().sum()
    mis_val_percent = 100 * df.isnull().sum() / len(df)
    mz_table = pd.concat([zero_val, mis_val, mis_val_percent], axis=1)
    mz_table = mz_table.rename(columns={0: 'Zero Values', 1: 'Missing Values', 2: '% of Total Values'})
    mz_table['Data Type'] = df.dtypes
    mz_table = mz_table[mz_table.iloc[:, 1] != 0].sort_values('% of Total Values', ascending=False).round(1)
    return mz_table

missing_zero_values_table(train_set)