I got an error when I tried to randomly retrieve rows from the matrix.
>>> x = [[0,0],[1,1],[2,2],[3,3],[4,4],[5,5]]
>>> perm = np.random.permutation(6)[:3]
>>> perm
array([0, 2, 4])
>>> x[perm]
TypeError: only integer arrays with one element can be converted to an index
I solved it by making the matrix np.array
>>> x = np.array(x)
>>> x[perm]
array([[0, 0],
[2, 2],
[4, 4]])
Recommended Posts