HW3-1: Used Car Price Analysis
You are a data scientist to analyzes the price of a used car. Currently, you have collected three pieces of data (Already provided the data loading in the next cell).
df_1.csv (Car Info Part 1)
df_2.csv (Car Info Part 2)
price.csv (Car Price)
Note: df_1 and df_2 contain the attributes: CarName, door number, fuel system, drivewheel, and horsepower. price is a 1D array that contains all the prices for your df_1 and df_2 data.
import pandas as pdimport numpy as npdf_1 = pd.read_csv('https://raw.githubusercontent.com/tisage/CISC540/main/data/Lab_3/df_1.csv', header = 0).valuesdf_2 = pd.read_csv('https://raw.githubusercontent.com/tisage/CISC540/main/data/Lab_3/df_2.csv', header = 0).valuesprice = pd.read_csv('https://raw.githubusercontent.com/tisage/CISC540/main/data/Lab_3/df_price.csv', header = 0).values
Before doing data analysis, you should fix & pre-process the data. Concatenate df_1, df_2, and price so that the completed data (a NumPy array) has 6 columns and 30 rows.
Write your code to concatenate three arrays to generate the completed NumPy array and preview the first 5 rows:
What is the shape of your data array?
What is the highest and lowest car price? Write your code.
Which car has the highest horsepower? Display its car information: car name, door number, fuel system, drivewheel, horsepower, and price. Is it the same car that has the highest price?
How many drivewheels are rwd and fwd respectively?
hint: np. where()
What's the mean average price for RWD and fwd cars? Write your code.