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
anasb / plot_corr.py
Last active Oct 20, 2019
Plot Correlations of Pandas DataFrame
View plot_corr.py
def plot_corr(df, size=10):
'''Function plots a graphical correlation matrix for each pair of columns in the dataframe.
Input:
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.