Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5 views

Python

Uploaded by

Neha Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Python

Uploaded by

Neha Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Data Visualization with Python

Data visualization provides a good, organized pictorial representation of the data


which makes it easier to understand, observe, analyze.
Python provides various libraries that come with different features for visualizing
data. All these libraries come with different features and can support various
types of graphs.
four such libraries are:
 Matplotlib
 Seaborn
 Bokeh
 Plotly
we will need a database to plot the data. We will be using the tips database
Tips Database
Tips database is the record of the tip given by the customers in a restaurant for
two and a half months in the early 1990s. It contains 6 columns such as total_bill,
tip, sex, smoker, day, time, size.

import pandas as pd
# reading the database
data = pd.read_csv("tips.csv")

# printing the top 10 rows


display(data.head(10))

Matplotlib
Matplotlib is an easy-to-use, low-level data visualization library that is built on
NumPy arrays. It consists of various plots like scatter plot, line plot, histogram,
etc.
To install this type the below command in the terminal.
pip install matplotlib
After installing Matplotlib, let’s see the most commonly used plots using this
library.
Scatter Plot
Scatter plots are used to observe relationships between variables and uses dots
to represent the relationship between them. The scatter() method in the
matplotlib library is used to draw a scatter plot.

Line Chart
Line Chart is used to represent a relationship between two data X and Y on a
different axis. It is plotted using the plot() function.

You might also like