you can use numpy.random.shuffle
import numpy as np N = 4601 data = np.arange(N*58).reshape(-1, 58) np.random.shuffle(data) a = data[:int(N*0.6)] b = data[int(N*0.6):int(N*0.8)] c = data[int(N*0.8):]