0% found this document useful (0 votes)
195 views

Python Dataframe Assignment No 1

This document outlines 10 questions for a Python DataFrame assignment using an automobile dataset. The questions involve printing specific rows, cleaning data, finding the most expensive car and company, filtering for Toyota cars, counting cars by company, finding the highest priced car for each company, calculating average mileage by company, sorting by price, concatenating data frames with company and price data for German and Japanese cars, and merging data frames on company for price and horsepower.

Uploaded by

Anni Kumar
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)
195 views

Python Dataframe Assignment No 1

This document outlines 10 questions for a Python DataFrame assignment using an automobile dataset. The questions involve printing specific rows, cleaning data, finding the most expensive car and company, filtering for Toyota cars, counting cars by company, finding the highest priced car for each company, calculating average mileage by company, sorting by price, concatenating data frames with company and price data for German and Japanese cars, and merging data frames on company for price and horsepower.

Uploaded by

Anni Kumar
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/ 1

PYTHON DATAFRAME

ASSIGNMENT NO 1
For this assignment, download the 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.
Question 1: From given data set print first and last five rows
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.
Question 4: Print All Toyota Cars details
Question 5: Count total cars per company
Question 6: Find each company’s Highest price car
Question 7: Find the average mileage of each car making company
Question 8: Sort all cars by Price column
Question 9: Concatenate two data frames using following conditions
Create two data frames using following two Dicts, Concatenate those two data frame 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]}

Question 10: Merge two data frames using following condition


Create two data frames using following two Dicts, Merge two data frames, and append
second data frame as a new column to 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]}

You might also like