text_plain_output_1.png
import numpy as np # linear algebra

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

data = pd.read_csv('../input/train.csv', dtype={'YearBuilt': 'str', 'YrSold': 'str', 'GarageYrBlt': 'str', 'YearRemodAdd': 'str'})
data.shape

missing_list = data.columns[data.isna().any()].tolist()
data.columns[data.isna().any()].tolist()

data.shape

data_org = data
data_org.shape
data.drop(['Alley', 'MasVnrArea', 'PoolQC', 'Fence', 'MiscFeature'], inplace=True, axis=1)
data.shape

numerics = ['int16', 'int32', 'int64', 'float16', 'float32', 'float64']
categorical = ['object']
for cols in list(data.select_dtypes(include=numerics).columns.values):
    data[cols] = data[cols].replace(np.nan, data[cols].median())
for cols in list(data.select_dtypes(include=categorical).columns.values):
    data[cols] = data[cols].replace(np.nan, 'Not_Available')

data.columns[data.isna().any()].tolist()

a = data.select_dtypes(include=numerics)
a.drop(['Id'], inplace=True, axis=1)
df = a.iloc[:, 2:3]
df.shape

sns.boxplot(df)
plt.show()