Week 15
Week 15
Week 15
Using pandas and matplotplib as analysis
and visualization tools
What is Pandas?
Initialize a dataset
View a dataset
Outline
Practice I
What is matplotlib?
Try to visualize
Use your data for visualization
Tips n Trick
Practice II
Submission
Before we start, here are some
information about dataset
What is Dataset? Dataset is a collection of data that
we import.
EVEN STUDENT ID
Import the dataset from the provided csv file named “SacramentocrimeJanuary2006.csv” and match the
output in Figure 2. Implement view functions to display the data.
Figure 1
Figure 2
What is matplotlib?
What is Data Visualization library from
Python.
matplotlib? matplotlib is a comprehensive Python
library that is useful for creating static and
interactive data visualizations in 2D and 3D.
What inside
matplotlib?
You can try every function in matplotlib
Resize Figure.
ADD This Code:
plt.figure(figsize=(W,H))
W = Width
H = Height
Example:
plt.figure(figsize=(16,10))
Use your data for visualization
Import Your library and CSV dataset.
Information
Pay Attention with your columns name
when you declare It on your code.
(Sensitive Case)
For more reference for this Broken Barh Click Here or Here.
Stacked Bar Graph
Result
For more reference About this Stacked Bar Chart Click Here.
Tips n Trick
(Additional)
Add label to your chart
Practice II
ODD Student ID
Import the dataset from the provided csv file named “worldometer_data.csv” then use 10 last data from
Dataset in Total cases of covid-19 and visualize the result for each country using
Bar Chart.
Even Student ID
Import the dataset from the provided csv file named “worldometer_data.csv” then use 10 last data from
Dataset in Total Recovered of covid-19 and visualize the result for each country
using Bar Chart.
Submission
Screenshot & Submit your file
Screenshot your code and the output, then put them into a pdf file. After that
upload them to eCampus or any given submission. Follow your assistant guidance
for submission regulations.
Questions?
References
California Housing Data Description
Sample Data
Ngodingdata.com