image_output_1.png
import pandas as pd

import seaborn as sns

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

g = sns.FacetGrid(all_df, col='test', sharex=True, sharey=False, size=5)
g = g.map(sns.distplot, 'bathrooms')

g = sns.FacetGrid(all_df[all_df['bathrooms'] < 10], col='test', sharex=True, sharey=False, size=5)
g = g.map(sns.countplot, 'bathrooms')

g = sns.FacetGrid(all_df, col='test', sharex=True, sharey=False, size=5)
g = g.map(sns.countplot, 'bedrooms')

sns.jointplot(data=all_df[all_df['train']], x='bedrooms', y='bathrooms', kind='reg')