I am rather surprised that
Numpy provides
x_data_train.append(...)
works at all. As x_data_train is a casual python list, append() takes only one argument - so you can make it work with either appending one array repeatedly or appending (or extending by) a list of your arrays. In either case you would end with a list (or even a list of lists) of arrays.Numpy provides
.concatenate()
, that should work for you:x_data_test = np.concatenate([x_data[0:20], x_data[45:64]])Another way would be to construct some "index" sequence and select on it - it could be list of numbers of wanted rows or list of booleans.