Answers for "'Series' object has no attribute 'reshape'"

1

attributeerror 'series' object has no attribute 'reshape' numpy concatenate

#I run in some issues in Predicting the Test set Results from
#multiple Linear Regression and I found the problem was that when 
#I pass the values from pandas Dataframe I didn't pass as numpy
#array first



data = pd.read_csv('Data.csv')
x=np.array(data.iloc[:,:-1])
y=np.array(data.iloc[:,-1])

.
.
.
.

# Predicting the Test set Results

y_pred = regressor.predict(x_test)
np.set_printoptions(precision=2) # Number of digitis of precision for floating point output (default 8).and

print(np.concatenate((y_pred.reshape(len(y_pred),1),y_test.reshape(len(y_test),1)),1))

# Now runs just fine
Posted by: Guest on June-22-2020
0

series has no attirubte reshape python

Y.values.reshape(-1,1)
Posted by: Guest on April-21-2020

Code answers related to "'Series' object has no attribute 'reshape'"

Python Answers by Framework

Browse Popular Code Answers by Language