Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

numpy shuffle along axis

def shuffle_along_axis(a, axis):
    idx = np.random.rand(*a.shape).argsort(axis=axis)
    return np.take_along_axis(a,idx,axis=axis)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #numpy #shuffle #axis
ADD COMMENT
Topic
Name
6+8 =