I have a 10x10 numpy matrix and I have a list containing indices of elements I want to query.
matrix = np.zeros((10, 10), dtype=int)
indices = [[2,3], [3,4]]
the issue I'm facing is, what I actually want is the element matrix[2,3] but matrix[indices[0]] gives a different output because the latter actually means matrix[[2,3]]. the output is 2 different rows.
How do I get around this problem?
arr[ [2,3], [3,4] ]orindices=([2,3], [3,4])andarr[indices]. numpy.org/doc/stable/reference/…