I try iterate over values of a 2d ndarray and get the index as well. Therefor I tried to sort the 2d ndarray. Also tried different things with (arg-)sorting parameters of numpy.
import numpy
arr = numpy.array([[2,11,4], [33,9,5], [3,21,123]])
print(arr.argsort(axis=None)
This returns:
array([0, 6, 2, 5, 4, 1, 7, 3, 8])
But I want to return a list like this where each list element contains the 2-dimensional index like this:
[(0,0), (2,0), (0,2), (1,2), (1,1), (0,1), (2,1), (1,0), (2,2)]