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
You can shuffle a two dimensional array A by row using the np.vectorize() function:
A
np.vectorize()
shuffle = np.vectorize(np.random.permutation, signature='(n)->(n)') A_shuffled = shuffle(A)