You can pass a list or array as indices to any np array.
>>> r = np.random.randint(0,10,(5,5)) >>> r array([[3, 8, 9, 8, 4], [4, 1, 5, 9, 1], [3, 6, 8, 8, 0], [5, 1, 7, 6, 1], [6, 1, 7, 7, 7]]) >>> idx = [0,3,1] >>> r[idx] array([[3, 8, 9, 8, 4], [5, 1, 7, 6, 1], [4, 1, 5, 9, 1]])