text_plain_output_1.png image_output_1.png
import pandas as pd

INPUT_DIR = '../input/'
TRAIN_FILE = 'train.json'
TEST_FILE = 'test.json'
train_df = pd.read_json(INPUT_DIR + TRAIN_FILE)
test_df = pd.read_json(INPUT_DIR + TEST_FILE)
all_df = pd.concat((train_df, test_df), axis=0)
all_df['train'] = all_df['interest_level'].notnull()
all_df['test'] = all_df['interest_level'].isnull()
n_train = train_df.shape[0]
n_test = test_df.shape[0]
n_total = n_train + n_test
n_train_pct = n_train / n_total * 100.0
n_test_pct = n_test / n_total * 100.0

def print_df_info(df, name):
    """
    Prints out more detailed DF info
    """
    print('\n{} Info:\n'.format(name))
    print(df.info())
    print('\n{} Null info by column:\n'.format(name))
    print(df.isnull().sum(axis=0))
    print('\n{} Statistical Description:\n'.format(name))
    print(df.describe())
print_df_info(train_df, 'Train')
print_df_info(test_df, 'Test')