Skip to content

Instantly share code, notes, and snippets.

Anas B anasb

Block or report user

Report or block anasb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
anasb /
Last active Oct 20, 2019
Plot Correlations of Pandas DataFrame
def plot_corr(df, size=10):
'''Function plots a graphical correlation matrix for each pair of columns in the dataframe.
df: pandas DataFrame
size: vertical and horizontal size of the plot'''
corr = df.corr()
fig, ax = plt.subplots(figsize=(size, size))
cax = ax.matshow(corr)
plt.xticks(range(len(corr.columns)), corr.columns, rotation=90)
You can’t perform that action at this time.