Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. X1 X2 X3 X4 X5 X6 X7 X8 Y1 Y2
  2. 0 0.98 514.5 294.0 110.25 7.0 2 0.0 0 15.55 21.33
  3. 1 0.98 514.5 294.0 110.25 7.0 3 0.0 0 15.55 21.33
  4. 2 0.98 514.5 294.0 110.25 7.0 4 0.0 0 15.55 21.33
  5. 3 0.98 514.5 294.0 110.25 7.0 5 0.0 0 15.55 21.33
  6. 4 0.90 563.5 318.5 122.50 7.0 2 0.0 0 20.84 28.28
  7.  
  8. data = pd.read_excel("ENB2012_data.xlsx")
  9. print(data.head())
  10. data = data[["X1", "X2", "X3", "X4", "X5", "X6", "X7", "X8"]]
  11. predict = "Y1"
  12. X = np.array(data.drop([predict], 1)) #the error lies on this line.
  13. Y = np.array(data[predict])
  14.  
  15. Error message: KeyError: "['Y1'] not found in axis"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement