@expect_dimensions(array=2)
def permute_rows(seed, array):
 rand = np.random.RandomState(seed)
 return np.apply_along_axis(rand.permutation, 1, array)

@ expect_dimensions ( array = 2 ) def permute_rows ( seed , array ) : rand = np . random . RandomState ( seed ) return np . apply_along_axis ( rand . permutation , 1 , array )
shuffle each row in array based on permutations generated by seed .