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 visualize data using Histogram plot in python?

Description

To visualize the data using histogram plot using python.

Process

  Load the data set from local memory.

  Bind the data into the data frame.

  Call the histogram plot method ax.hist()from matplotlib.pyplot.

Sample Code

#import library

import matplotlib.pyplot as plt

import pandas as pd

#read CSV file

data=pd.read_csv

(‘/home/soft27/soft27/Sathish/

Pythonfiles/Employee.csv’)

#create the Data frame

df=pd.DataFrame(data)

#initialize the figure object

fig=plt.figure()

ax = fig.add_subplot(1,1,1)

#calling the histogram plot method

ax.hist(df[‘Salary’])

plt.title(‘Employee Distribution’)

plt.xlabel(‘Age’)

plt.ylabel(‘Salary’)

plt.show()

Screenshots
visualize data using Histogram plot in python