Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Python P1

● Import the necessary libraries


● Import the first dataset cars1 and cars2.
● Assign each to a variable called cars1 and cars2
● Oops, it seems our first dataset has some unnamed blank columns, fix cars1
● What is the number of observations in each dataset?
● Join cars1 and cars2 into a single DataFrame called cars
● Oops, there is a column missing, called owners. Create a random number Series from
15,000 to 73,000.
● Add the column owners to cars
Dataset -
https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/05_Merge/Auto_MPG/cars1.csv
https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/05_Merge/Auto_MPG/cars2.csv

Python P2

● Import the necessary libraries


● Import the dataset from this address.
● Assign it to a variable called online_rt
Note: if you receive a utf-8 decode error, set encoding = 'latin1' in pd.read_csv().
● Create a histogram with the 10 countries that have the most 'Quantity' ordered except
UK
● Exclude negative Quantity entries
● Create a scatterplot with the Quantity per UnitPrice by CustomerID for the top 3
Countries (except UK)
● Plot a line chart showing revenue (y) per UnitPrice (x).
Dataset -
https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/07_Visualization/Online_Retail/
Online_Retail.csv

Python P3
● Import these 2 datasets and check the heads. name the columns or the first
dataset as below.
https://media.geeksforgeeks.org/wp-content/uploads/file.tsv
(column names - 'user_id', 'item_id', 'rating', 'timestamp')

'https://media.geeksforgeeks.org/wp-content/uploads/Movie_Id_Ti
tles.csv'
● Calculate mean rating of all movies
● Calculate count rating of all movies
● Create dataframe with 'rating' count values and mean rating of each movie .
This will be movie wise count or ratings and mean rating.
● Plot graph of 'num of ratings column'. This will be a historam chart using the
above ratings dataframe
● Plot graph of 'ratings' column. A histogram with average rating column
● analyse correlation of Star Wars with other movies [correlation or ratings]
● analyse correlation of 12 Angry Men with other movies [correlation or ratings]

You might also like