Question: Solve using PYTHON Write a script that reads a file cars.csv, into a pandas structure and then print Get the first column and the second

Solve using PYTHON

Write a script that reads a file cars.csv, into a pandas structure and then print Get the first column and the second to last column from cars.csv

Perform following operations on these two vectors and print the result

addition and subtraction.convert a pandas dataframe to a numpy array element-wise multiplication

inner product

three norms

compute the distance between these two vectors

2) Get the first three columns and the last three columns from cars.csv

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

car.csv file

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 Toyota Corolla Mark ii,24,4,113,95,2372,15,70,Japan Plymouth Duster,22,6,198,95,2833,15.5,70,US AMC Hornet,18,6,199,97,2774,15.5,70,US Ford Maverick,21,6,200,85,2587,16,70,US Datsun PL510,27,4,97,88,2130,14.5,70,Japan Volkswagen 1131 Deluxe Sedan,26,4,97,46,1835,20.5,70,Europe Peugeot 504,25,4,110,87,2672,17.5,70,Europe Audi 100 LS,24,4,107,90,2430,14.5,70,Europe Saab 99e,25,4,104,95,2375,17.5,70,Europe BMW 2002,26,4,121,113,2234,12.5,70,Europe AMC Gremlin,21,6,199,90,2648,15,70,US Ford F250,10,8,360,215,4615,14,70,US Chevy C20,10,8,307,200,4376,15,70,US Dodge D200,11,8,318,210,4382,13.5,70,US

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!