[Solved] COMP1007 Assignment4-fundamental operations of Pandas DataFrame

$25

File Name: COMP1007_Assignment4-fundamental_operations_of_Pandas_DataFrame.zip
File Size: 593.46 KB

SKU: [Solved] COMP1007 Assignment4-fundamental operations of Pandas DataFrame Category: Tag:
5/5 - (1 vote)

This assignment helps you review the fundamental operations of Pandas DataFrame. Please download the data file automobile_data.csv from Moodle, and develop a Python program that performs the following tasks:

  1. Create a Pandas DataFrame by loading the file csv.
  2. Show the shape of the DataFrame.
  3. Show the first 8 rows and the last 8 rows of your DataFrame.
  4. Show the data types of every column of your DataFrame.
  5. There are some rows with missing data. Please drop these rows from the DataFrame.
  6. Show the shape of the DataFrame again.
  7. Create a new DataFrame that consists of all the rows of Toyota cars. You can first use groupby() function to generate a GroupBy object, and then use GroupBy.get_group() function to generate the DataFrame object. You can learn from the Grouping example at

https://pandas.pydata.org/pandasdocs/stable/user_guide/cookbook.html ([114], [115], [117], [118]).

  1. Find the average mileage of each car company. You can make use the GroupBy object created in Step 7.
  2. Sort all cars by the price column in descending order, and save the sorted table in a new CSV file automobile_data_new.csv. You can use the to_csv() function.
  3. Show the statistics information (such as mean, std, min, max, and 25/50/75% percentiles) of the final DataFrame.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] COMP1007 Assignment4-fundamental operations of Pandas DataFrame
$25