text_plain_output_1.png image_output_1.png
from scipy.stats import norm, skew

import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sns

import pandas as pd
train = pd.read_csv('../input/train.csv')
test = pd.read_csv('../input/test.csv')

train = pd.read_csv('09-house-train.csv')
test = pd.read_csv('09-house-test.csv')

train.drop(['Id'], axis=1, inplace=True)
test.drop(['Id'], axis=1, inplace=True)

train.iloc[0:5, :3]

null_cols = pd.DataFrame(train.isnull().sum().sort_values(ascending=False), columns=['Null Data Count'])
null_cols_pct = pd.DataFrame(round(train.isnull().sum().sort_values(ascending=False) / len(train), 2) * 100, columns=['Null Data Pct'])
null_cols_df = pd.DataFrame(pd.concat([null_cols, null_cols_pct], axis=1))
all_nulls = null_cols_df[null_cols_df['Null Data Pct'] > 0]
all_nulls

plt.xticks(rotation='90')

saleprice_df = pd.concat([train.SalePrice, np.log(train.SalePrice + 1).rename('LogSalePrice')], axis=1, names=['SalePrice', 'LogSalePrice'])

sns.set_style('white')
sns.set_color_codes(palette='deep')
fig, ax = plt.subplots(figsize=(18, 5), ncols=2, nrows=1)
ax1 = sns.distplot(saleprice_df.SalePrice, kde=False, fit=norm, ax=ax[0])
ax2 = sns.distplot(saleprice_df.LogSalePrice, kde=False, fit=norm, ax=ax[1])
ax1.set_title('SalePrice Distribution')
ax2.set_title('LogSalePrice Distribution')