Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

seaborn correlation heatmap

import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
#Seaborn again offers a neat tool to visualize pairwise correlation coefficients. 
#The heatmap takes the DataFrame with the correlation coefficients as inputs, 
#and visualizes each value on a color scale that reflects the range of relevant. values.
#The parameter annot equals True ensures that the values of the correlation 
#coefficients are displayed as well
sns.heatmap(df.corr(), annot =True )
sns.set(rc = {'figure.figsize':(8,8)})#<--responsible for changing the size of a seaborn plot
plt.show()
 
PREVIOUS NEXT
Tagged: #seaborn #correlation #heatmap
ADD COMMENT
Topic
Name
3+2 =