text_html_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sb

df = pd.read_csv('../input/kc_house_data.csv')

#df correlation matrix
f,ax = plt.subplots(figsize=(12, 9))
sb.heatmap(df.corr(), annot=True, linewidths=.5, fmt='.1f', ax=ax)

sb.set()
cols = df[['price', 'sqft_living', 'grade', 'sqft_above', 'bathrooms', 'sqft_living15']]

k = 10
corrmat = df.corr()
cols = corrmat.nlargest(k, 'price')['price'].index
cm = np.corrcoef(df[cols].values.T)
sb.set(font_scale=1.25)
hm = sb.heatmap(cm, cbar=True, annot=True, square=True, fmt='.2f', annot_kws={'size': 10}, yticklabels=cols.values, xticklabels=cols.values)
plt.show()