I have a multi-dimensional NumPy array, that is acting as input data to my neural network. I have 2115 different (6,100,60) samples. I want to shuffle my data - rearrange the order - of the 2115 (6,100,60) samples. I want to make sure the channels, columns, and rows of (6,100,60) all stay in place - i.e., I only want to shuffle the location (in the array) of these 2115 samples.
I am not sure how to do this - any help would be appreciated.
Thank you.
You can shuffle the sample number (assuming first dimension) then reindex:
order = np.random.permutation(np.arange(2115)) data = data[order]
2.1m questions
2.1m answers
60 comments
57.0k users