I have one 2d array:
>>> input = np.array([[1,2],[3,4]])
>>> input
array([[1, 2],
[3, 4]])
and I also have this array which has the same number of columns as the input array and each lines contain the index to extract from the matching column of the input array.
>>> indices = np.array([[0],[1]])
>>> indices
array([[0],
[1]])
In this example I would like to get the following array as output:
array([[1],
[4]])
Any way I can achieve that?