Question: For my Python lab I have to load data with pandas, convert a pandas dataframe to a numpy array and then get the first column

For my Python lab I have to load data with pandas, convert a pandas dataframe to a numpy array and then get the first column and the second to last column from numpy array as vectors. Everything was working fine, but I also have to find the inner product of product of the vectors and I keep getting this error. How do I fix it?
In [2]; import numpy as np import pandas as pd # load data with pandas df = pd.read_csv('/Users/maguireqvale/cars.cvs') #convert a pandas dataframe to a numpy array X = df.values[:, 1:-1] #Get the first column and the second to last column from X as vectors c1 X[:,:1] c2 = X[:,1:] # 3. inner product np.inner (ci, c2) ValueError Traceback (most recent call last)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
