IndexError: index 10 is out of bounds for axis 1 with size 10
14:59 02 May 2017

I am trying to define a variable Ytest which has the 10 column entries or the label entries from my excel sheet.

names = ["Variable1","Variable2","Variable3","Variable4","Variable5","Variable6","Variable7","Variable8","Variable9","label"]
filename = 'C:/Users/qwert/test.csv'
dataframe = read_csv(filename, names=names)
dataframe.head(6)
array = dataframe.values
array.shape
(16259, 10)

X_train= array[0:1162,0:9]
X_train.shape
(1162, 9)

X_test= array[1163:2300,0:9]
X_test.shape
(1137, 9)

y_test=array[1163:2300,10]
y_test.shape

But it gives me error

IndexError Traceback (most recent call last)  in () 1 #y_test=array[1163:2300,0:10] ----> 2 y_test=array[1163:2300,10] 3 y_test.shape IndexError: index 10 is out of bounds for axis 1 with size 10

Am I missing something here ? I basically wanted all my labels which are in 10 column of my excel to be in y_test

python arrays