Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- X1 X2 X3 X4 X5 X6 X7 X8 Y1 Y2
- 0 0.98 514.5 294.0 110.25 7.0 2 0.0 0 15.55 21.33
- 1 0.98 514.5 294.0 110.25 7.0 3 0.0 0 15.55 21.33
- 2 0.98 514.5 294.0 110.25 7.0 4 0.0 0 15.55 21.33
- 3 0.98 514.5 294.0 110.25 7.0 5 0.0 0 15.55 21.33
- 4 0.90 563.5 318.5 122.50 7.0 2 0.0 0 20.84 28.28
- data = pd.read_excel("ENB2012_data.xlsx")
- print(data.head())
- data = data[["X1", "X2", "X3", "X4", "X5", "X6", "X7", "X8"]]
- predict = "Y1"
- X = np.array(data.drop([predict], 1)) #the error lies on this line.
- Y = np.array(data[predict])
- Error message: KeyError: "['Y1'] not found in axis"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement