How can I shuffle a multidimensional array by row only in Python (so do not shuffle the columns).
I am looking for the most efficient solution, because my ma
I have a question on this (or maybe it is the answer) Lets say we have a numpy array X with shape=(1000,60,11,1) Also suppose that X is an array of images with size 60x11 and channel number =1 (60x11x1).
What if I want to shuffle the order of all these images, and to do that I'll use shuffling on the indexes of X.
def shuffling( X):
indx=np.arange(len(X)) # create a array with indexes for X data
np.random.shuffle(indx)
X=X[indx]
return X
Will that work? From my knowledge len(X) will return the biggest dimension size.