Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas plot heatmap

import matplotlib.pyplot as plt
import seaborn as sns

# optional: resize images from now on
plt.rcParams["figure.figsize"] = (16, 12)

# numeric_only_columns is a list of columns of the DataFrame
# containing numerical data only
# annot = True to visualize the correlation factor

sns.heatmap(df[numeric_only_columns].corr(), annot = False)
plt.show()
 
PREVIOUS NEXT
Tagged: #pandas #plot #heatmap
ADD COMMENT
Topic
Name
7+8 =