I have a numpy array that looks like this: [-1,0,1,0,1,2,1,2,3, ..., n-1, n, n + 1, n, n + 1 , N + 2 ..] I would like to shuffle the array in pieces 3, is there an efficient way to do this in numpy?
I know that you can shuffle a numpy array using the following shuffle method, but this gives me a fully shuffled array. Is there any way to shuffle it in pieces in numpy?
import numpy.random as rng ind = numpy.arange(100) rng = numpy.random.RandomState(123) rng.shuffle(ind)
source share