Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to create correlation heatmap in python

# import modules
import matplotlib.pyplot as mp
import pandas as pd
import seaborn as sb
  
# import file with data
data = pd.read_csv("C:UsersVanshiDesktopestsellers.csv")
  
# prints data that will be plotted
# columns shown here are selected by corr() since
# they are ideal for the plot
print(data.corr())
  
# plotting correlation heatmap
dataplot = sb.heatmap(data.corr(), cmap="YlGnBu", annot=True)
  
# displaying heatmap
mp.show()
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #create #correlation #heatmap #python
ADD COMMENT
Topic
Name
7+5 =