We will illustrate various options for splitting data into training and test sets by showing how the indices of a mock dataset with ten observations are assigned to the train and test set (see cross_validation.py for details), as shown in following code:
data = list(range(1, 11))
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]