I have a 2-D array that looks like this:
my_array = np.array([[1,7]
[2,4]
[3,10]
[4,3]
[5,23]])
and I have an index array which looks like this:
index_array = np.array([0,2,3])
as an output I want to get a matrix containing only the rows from the index array so the shape of the output matrix should be (3,2) and it should look like this:
[[1,7]
[3,10]
[4,3]]
The solution shouldn't use a for loop and should work with any 2-D matrix. Thanks in advance :)