text_plain_output_1.png image_output_1.png
import matplotlib.pylab as pylab

import numpy as np

import pandas as pd

import seaborn as sns

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

sorted(list(df.columns))

col_names = df.columns
bool_cols = []
nonbool_cols = []
for c in col_names:
    if len(df[c].unique()) == 2:
        bool_cols.append(c)
        df[c] = df[c].astype('bool')
    else:
        nonbool_cols.append(c)

df.pivot_table(index=['bacon'], values=['calories', 'rating'], aggfunc=np.mean)

pylab.rcParams['figure.figsize'] = (12, 12)
corrmat = df[bool_cols[0:20]].corr()
sns.heatmap(corrmat, vmax=0.8, square=True)