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

Solutions on MaxInterview for attributeerror 27series 27 object has no attribute 27reshape 27 numpy concatenate by the best coders in the world

showing results for - "attributeerror 27series 27 object has no attribute 27reshape 27 numpy concatenate"
Hannah
01 Oct 2020
1#I run in some issues in Predicting the Test set Results from
2#multiple Linear Regression and I found the problem was that when 
3#I pass the values from pandas Dataframe I didn't pass as numpy
4#array first
5
6
7
8data = pd.read_csv('Data.csv')
9x=np.array(data.iloc[:,:-1])
10y=np.array(data.iloc[:,-1])
11
12.
13.
14.
15.
16
17# Predicting the Test set Results
18
19y_pred = regressor.predict(x_test)
20np.set_printoptions(precision=2) # Number of digitis of precision for floating point output (default 8).and
21
22print(np.concatenate((y_pred.reshape(len(y_pred),1),y_test.reshape(len(y_test),1)),1))
23
24# Now runs just fine
Simona
30 Feb 2016
1Y.values.reshape(-1,1)