Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Correlation map of the impact of air quality on mortality rates
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set_style('white')
def plot_correlation_map(df):
corr = train.corr()
_, ax = plt.subplots(figsize=(12, 10))
cmap = sns.diverging_palette(220, 10, as_cmap=True)
_ = sns.heatmap(
corr,
cmap=cmap,
square=True,
cbar_kws={'shrink': .9},
ax=ax,
annot=True,
annot_kws={'fontsize': 12}
)
train = pd.read_csv('./data/train.csv', parse_dates=['date'])
test = pd.read_csv('./data/test.csv')
plot_correlation_map(train)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment