Question: please help in python. read cars.csv and do these step cars.csv file. X is cars.csv Car,MPG,Cylinders,Displacement,Horsepower,Weight,Acceleration,Model,Origin Chevrolet Chevelle Malibu,18,8,307,130,3504,12,70,US Buick Skylark 320,15,8,350,165,3693,11.5,70,US Plymouth Satellite,18,8,318,150,3436,11,70,US AMC
please help in python. read cars.csv and do these step
cars.csv file. X is cars.csv
Car,MPG,Cylinders,Displacement,Horsepower,Weight,Acceleration,Model,Origin Chevrolet Chevelle Malibu,18,8,307,130,3504,12,70,US Buick Skylark 320,15,8,350,165,3693,11.5,70,US Plymouth Satellite,18,8,318,150,3436,11,70,US AMC Rebel SST,16,8,304,150,3433,12,70,US Ford Torino,17,8,302,140,3449,10.5,70,US Ford Galaxie 500,15,8,429,198,4341,10,70,US Chevrolet Impala,14,8,454,220,4354,9,70,US Plymouth Fury iii,14,8,440,215,4312,8.5,70,US Pontiac Catalina,14,8,455,225,4425,10,70,US AMC Ambassador DPL,15,8,390,190,3850,8.5,70,US Citroen DS-21 Pallas,0,4,133,115,3090,17.5,70,Europe Chevrolet Chevelle Concours (sw),0,8,350,165,4142,11.5,70,US Ford Torino (sw),0,8,351,153,4034,11,70,US Plymouth Satellite (sw),0,8,383,175,4166,10.5,70,US AMC Rebel SST (sw),0,8,360,175,3850,11,70,US Dodge Challenger SE,15,8,383,170,3563,10,70,US Plymouth 'Cuda 340,14,8,340,160,3609,8,70,US Ford Mustang Boss 302,0,8,302,140,3353,8,70,US Chevrolet Monte Carlo,15,8,400,150,3761,9.5,70,US Buick Estate Wagon (sw),14,8,455,225,3086,10,70,US 



2.1 Get the first column and the second to last column from X 2.2 Perform following operations on these two vectors and print the result # this is your code to get two vectors import pandas as pd # 1. addition and subtraction # convert a pandas dataframe to a numpy array #df.head() # 2. element-wise multiplication # 3. inner product # 4. three norms # 5. compute the distance between these two vectors 2.3 Get the first three columns and the last three columns from X # this is your code to get two matrices: A, B import pandas as pd df = pd. read_csv ("cars.csv") first_3_column df.iloc[3: , :] last_3_column df.iloc[:, -3:] print(df) Perform following operations on these two matrices and print the result . . addition and subtraction . compute the transpose of the second matrix: C = B^T, and print the shape of C compute the product between A and c, and print the result and its shape . compute the transpose of the first matrix: D = A^T, and print the shape of D = compute the product between D and B, and print the result and its shape
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
