text_plain_output_1.png
import matplotlib.pyplot as plt

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

import seaborn as sns

df = pd.read_csv('../input/house-prices-advanced-regression-techniques/train.csv')

def NanColums(df):
    percent_nan = 100 * df.isnull().sum() / len(df)
    percent_nan = percent_nan[percent_nan > 0].sort_values()
    return percent_nan
nanColums = NanColums(df)
plt.xticks(rotation=90)

del df['Alley']
del df['PoolQC']
del df['MiscFeature']
df['MasVnrType'].fillna(value='0', inplace=True)
df['MasVnrArea'].fillna(value=0.0, inplace=True)
df['BsmtQual'].fillna(value='0', inplace=True)
df['BsmtCond'].fillna(value='0', inplace=True)
df['BsmtExposure'].fillna(value='0', inplace=True)
df['BsmtFinType1'].fillna(value='0', inplace=True)
df['BsmtFinType2'].fillna(value='0', inplace=True)
df['FireplaceQu'].fillna(value='0', inplace=True)
df['Electrical'].fillna(value='0', inplace=True)
df['GarageType'].fillna(value='0', inplace=True)
df['GarageYrBlt'].fillna(value=0.0, inplace=True)
df['GarageFinish'].fillna(value='0', inplace=True)
df['GarageQual'].fillna(value='0', inplace=True)
df['GarageCond'].fillna(value='0', inplace=True)
df['Fence'].fillna(value='0', inplace=True)
df['LotFrontage'] = df.groupby('Neighborhood')['LotFrontage'].transform(lambda val: val.fillna(val.mean()))
df = pd.get_dummies(df)

sns.heatmap(df.corr(), xticklabels=True, yticklabels=True)
plt.show()