Doubt in classification

While in classification to split the data into train and test set and also to shuffle it we used the code
X_train, X_test, y_train, y_test = X[:60000], X[60000:], y[:60000], y[60000:]
np.random.seed(42)
shuffle_index = np.random.permutation(60000)
X_train, y_train = X_train[shuffle_index], y_train[shuffle_index]
so in this we split first 60000 sets of data and set it as training set what if the values from 1 to 9 are given in ascending order so because of that we many not train the complete set. If this is the case then what code should we use to split the set of data into train and test set

HI @Visaal_K.S,

The MNIST dataset is actually already split into a training set
(the first 60,000 images) and a test set (the last 10,000 images):

X_train, X_test, y_train, y_test = X[:60000], X[60000:], y[:60000], y[60000:]

is doing this for us.

Regards