Research breakthrough possible @S-Logix pro@slogix.in

Office Address

  • 2nd Floor, #7a, High School Road, Secretariat Colony Ambattur, Chennai-600053 (Landmark: SRM School) Tamil Nadu, India
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to plot heat maps in python?

Description

To plot heap maps for input variables using python.

Process

   Import libraries.

  Heat maps one of the advanced for data visualization in python.

  Take sample data (Rows and columns).

  Define rows and columns according to our data set.

  Use plt.pcolor() to plot heat maps diagram.

Sample Code

#import libraries
import matplotlib.pyplot as plt
import pandas as pd

#take sample
data=[{650.5,553.2,619},{789,845.2,598},{650.5,553.2,619},{598,732.8,722.2},{553.2,619,789}]
print(“Data\n”,data)
#define how many rows
Index= [‘I1’, ‘I2′,’I3′,’I4′,’I5’]

#define how many columns
Cols = [‘C1’, ‘C2’, ‘C3’]
#create data frame
df = pd.DataFrame(data, index=Index, columns=Cols)

#plot the diagram
plt.pcolor(df)
plt.show()

Screenshots
plot heat maps in python