numpy.ndenumerate to return indices in Fortran order?
You can do it with np.nditer
as follows:
it = np.nditer(a, flags=['multi_index'], order='F')while not it.finished: print it.multi_index, it[0] it.iternext()
np.nditer
is a very powerful beast that exposes some of the internal C iterator in Python, take a look at Iterating Over Arrays in the docs.