I have a 2d array:
a = np.random.randint(100, size=(6, 4))
[[72 76 40 11]
[48 82 6 87]
[53 24 25 99]
[ 7 94 82 90]
[28 81 10 9]
[94 99 67 58]]
And a 1d array:
idx = np.random.randint(4, size=6)
[0, 3, 2, 1, 0, 2]
Is it possible to index the 2d array so that the result is:
a[idx]
[72, 87, 25, 94, 28, 67]