ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 4 is different from 1)

The above error occurs when i run the following code:

x=df[[‘highwaympg’]]
z=df[[‘horsepower’,‘curbweight’,‘enginesize’,‘highwaympg’]]
lm.fit(z,df[‘price’])
yhat=lm.predict(x)

© Copyright 2013-2019 Analytics Vidhya