Python Pandas Test Exercise:-
[In this exercise, we are using Automobile Dataset for data analysis.
This Dataset has different characteristics of an auto such as body-
style, wheel-base, engine-type, price, mileage, horsepower, etc.]
Exercise 1: From the given dataset print the first and last five rows
Expected Output:
Python Pandas printing first 5 rows
Python Pandas printing last 5 rows
Exercise 2: Clean the dataset and update the CSV file
Replace all column values which contain ?, n.a, or NaN.
Exercise 3: Find the most expensive car company name
Print most expensive car’s company name and price.
Expected Output:
Python Pandas printing most costly car name
Exercise 4: Print All Toyota Cars details
Expected Output:
Python Pandas printing all Toyota cars data
Exercise 5: Count total cars per company
Expected Outcome:
Python Pandas count total cars per company
Exercise 6: Find each company’s Highest price car
Expected Outcome:
Exercise 7: Find the average mileage of each car making company
Expected Output:
Exercise 8: Sort all cars by Price column
Expected Output:
Python Pandas sort all cars by price column
Exercise 9: Concatenate two data frames using the following
conditions
Create two data frames using the following two dictionaries.
GermanCars = {'Company': ['Ford', 'Mercedes', 'BMV', 'Audi'],
'Price': [23845, 171995, 135925 , 71400]}
japaneseCars = {'Company': ['Toyota', 'Honda', 'Nissan', 'Mitsubishi
'], 'Price': [29995, 23600, 61500 , 58900]}
Expected Output:
Python Pandas concatenate two data frames and create a key for
each data frame.
Exercise 10: Merge two data frames using the following condition
Create two data frames using the following two Dicts, Merge two
data frames, and append the second data frame as a new column to
the first data frame.
Car_Price = {'Company': ['Toyota', 'Honda', 'BMV', 'Audi'], 'Price':
[23845, 17995, 135925 , 71400]}
car_Horsepower = {'Company': ['Toyota', 'Honda', 'BMV', 'Audi'],
'horsepower': [141, 80, 182 , 160]}
Expected Output:
Python Pandas merge two data frames and append new data frame
as a new column.