Data Processing Using Python and Pandas Assignment

Download Solution Order New Solution

Overview


Task Description:

In this assignment, you will create a Jupyter Notebook and use Python and Pandas to analyse and visualise a real engineering data set.

Unit Learning Outcomes Assessed:

  • ULO 1: Create your own software – you will learn a programming language and how to design and implement simple algorithms.

  • ULO 2: Manipulate engineering data flexibly and efficiently by creating your own scripts and simple programs to handle the specific tasks.

  • ULO 4: Ensure software is correct, clear and maintainable by applying introductory-level software development principles and processes.


Assessment Summary Table:

Estimated Time for Completion, Weighting Group or Individual How I Will Be Assessed, hours 30% of final grade, Individua,l Using a 7-Point Grading Scale

What You Need to Do

In this assignment, we are looking at car-related data collected from various manufacturers. The dataset includes:

  • Car make and model

  • Year of production

  • Engine size

  • Horsepower

  • Torque

  • 0–60 MPH time

  • Price (in USD)

This analysis will help identify market trends and inform the design of a car physics engine in Assignment 3.


Dataset Format (CSV):

The dataset has the following attributes and descriptions:

Attribute Description Car Make The make of the car, representing the brand/company that produced it (e.g., Porsche, Lamborghini, Ferrari, Audi, McLaren). Car Model The specific model/variant of the car (e.g., 911, Huracan, 488 GTB, R8, 720S, M8, AMG GT, Corvette, Mustang Shelby GT500, GT-R Nismo). Year The model year of the car – when it was introduced or became available for purchase. Engine Size (L) Size of the engine in litres (volume of the engine’s cylinders). Larger engine sizes usually indicate higher power. Range: 2.0L to 8.0L.

Sports Car Dataset Analysis – Instructions & Tasks

Dataset Variable Descriptions

  • Engine Size (L):
    The size of the car's engine in liters, indicating the engine’s cylinder volume. Larger engine size typically equates to higher power and performance. Range: 2.0L to 8.0L (some may use electric motors).

  • Horsepower:
    Represents engine power output. Higher horsepower = faster acceleration and top speed. Range: 300 to 1479.

  • Torque (lb-ft):
    The engine's rotational force. Higher torque = better acceleration and handling. Range: 270 to 1180.

  • 0–60 MPH Time (seconds):
    Time required for acceleration from 0 to 60 mph. Lower times = better performance. Range: 1.85 to 5.3 seconds.

  • Price (in USD):
    Cost of the car in USD. Range: $25,000 to $3,000,000.


Instructions for Data Analysis Using Pandas

These tasks will demonstrate your ability to:

  1. Clean: Fix irregularities to create a clean CSV format.

  2. Read: Import the cleaned CSV into a DataFrame.

  3. Convert: Manage different date/time formats.

  4. Filter: Restrict rows/columns for specific queries.

  5. Aggregate: Use functions like mean, sum, and max for data summarization.

  6. Group: Apply group-by operations for categorical data.

  7. Create Columns: Generate new columns from existing ones.

  8. Visualize: Use Pandas’ plotting capabilities.

  9. Meaningful Plots: Label plots clearly for readability.

  10. Markdown: Use markdown to document findings and summarize key observations.

  11. Functions: Reuse logic using functions.

  12. Best Practices: Use simple and well-named Python code.


Tasks

  1. Use markdown to explain checks ensuring the dataset is clean (Hint: use consistency checks).

  2. Load the clean CSV into a Pandas DataFrame.

  3. Identify and print the Make, Model, and Year of the car with the maximum engine size.

  4. Compute the average price of all cars.

  5. Add a new column for the price per horsepower.

  6. Plot a bar chart showing the 10 fastest cars (based on 0-60 mph).

  7. Plot a histogram of engine size.

  8. Create a scatter plot of engine size vs torque.

Tasks

  1. Markdown Documentation:
    Use markdown to record any data validation checks to ensure the dataset is clean.
    Hint: Consistency checks are essential before processing data.

  2. Read CSV Data:
    Load the cleaned CSV file into a Pandas DataFrame.

  3. Find Max Engine Size Car:
    Identify the car with the maximum engine size and print its Make, Model, and Year.

  4. Average Price Calculation:
    Compute the average price of all the cars in the dataset.

  5. Price per Horsepower:
    Create a new column to show price per horsepower for each car.

  6. Bar Chart – Fastest Cars:
    Display a bar chart of the 10 fastest cars based on 0–60 mph time.

  7. Histogram – Engine Size:
    Plot a histogram of engine sizes, grouped (binned) to full liters.

  8. Scatterplot – Engine Size vs Torque:
    Show a scatter plot to illustrate the relationship between engine size and torque.

  9. Filter by Model Name:
    Create a table of all cars where the model name starts with the letter 

  10. Torque of Electric Cars:
    Print the torque values of electric cars sorted in ascending order.


Important Notes

  • All data processing must be done using Pandas.

  • Use only the Python/Pandas features covered in class or practicals.

  • Do not use external libraries, R, MATLAB, Excel, or other tools.

  • Zero marks will be awarded for using tools not permitted, even if your solution is correct.


What to Submit

 A single  (Jupyter Notebook) file containing:

  • Code cells performing all 10 tasks

  • Markdown cells for explanation and observations

  • Clean, readable, and well-documented code

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.