Answers for "plot correlation matrix python"

3

correlation matrix python

import seaborn as sns
df = sns.load_dataset('iris')
corr_matrix = df.corr()
corr_matrix.style.background_gradient(cmap='coolwarm')
# 'RdBu_r', 'BrBG_r', & PuOr_r are other good diverging colormaps
Posted by: Guest on August-31-2021
0

seaborn create a correlation matrix

import seaborn as sns
%matplotlib inline

# calculate the correlation matrix
corr = auto_df.corr()

# plot the heatmap
sns.heatmap(corr, 
        xticklabels=corr.columns,
        yticklabels=corr.columns)
Posted by: Guest on December-07-2020

Code answers related to "plot correlation matrix python"

Python Answers by Framework

Browse Popular Code Answers by Language