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
print('Train DF Shape: {}, %age: {:.1f}'.format(train_df.shape, n_train_pct))
print('Test  DF Shape: {}, %age: {:.1f}'.format(test_df.shape, n_test_pct))