test_idx = numpy.random.randint(x.shape[0], size=20)
training, test = x[(training_idx), :], x[(test_idx), :]
Numpy: How to split/partition a dataset (array) into training and test datasets for, e.g., cross validation?