Amazing technological breakthrough possible @S-Logix pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to visualize data using scatter plot using python?

Description

To visualize the data using scatter plot in python.

Process

  Load the data set.

  Create the data frame to bind the data.

  Calling scatter plot method,from matplotlib.pyplot.

Sample Code

#imported libraries

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 scatter plot method

ax.scatter(df[‘Age’],df[‘Salary’])

plt.title(‘Employee Distribution’)

plt.xlabel(‘Age’)

plt.ylabel(‘Salary’)

plt.show()

Screenshots
visualize data using scatter plot using python