This Pandas exercise project will help Python developer to learn and practice pandas. Pandas is an open-source, BSD-licensed Python library. Pandas is a handy and useful data-structure tool for analyzing large and complex data.
Practice DataFrame, Data Selection, Group-By, Series, Sorting, Searching, statistics. Practice Data analysis using Pandas. For this exercise, we are using Automobile Dataset. This Automobile Dataset has a different characteristic of an auto such as body-style, wheel-base, engine-type, price, mileage, horsepower and many more.
What included in this Pandas exercise?
This exercise contains 10 questions. The solution provided for each question. Each question includes a specific Pandas topic you need to learn, When you complete each question you get more familiar with data analysis using pandas.
Question 1: From given data set print first and last five rows
Expected Output:
Question 2: Clean data and update the CSV file
Replace all column values which contain ‘?’ and n.a with NaN.
Question 3: Find the most expensive car company name
Print most expensive car’s company name and price.
Expected Output:
Question 4: Print All Toyota Cars details
Expected Output:
Question 5: Count total cars per company
Expected Outcome:
Question 6: Find each company’s Higesht price car
Expected Outcome:
Question 7: Find the average mileage of each car making company
Expected Output:
Question 8: Sort all cars by Price column
Expected Output:
Question 9: Concatenate two data frames using the following conditions
Create two data frames using the following two Dicts, Concatenate those two data frames and create a key for each data frame.
GermanCars = {'Company': ['Ford', 'Mercedes', 'BMV', 'Audi'], 'Price': [23845, 171995, 135925 , 71400]} japaneseCars = {'Company': ['Toyota', 'Honda', 'Nissan', 'Mitsubishi '], 'Price': [29995, 23600, 61500 , 58900]}
Expected Output:
Question 10: Merge two data frames using the following condition
Create two data frames using the following two Dicts, Merge two data frames, and append 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: