When using numpy.ndenumerate indexes are returned as follows for the order of the C-contiguous , for example:
import numpy as np a = np.array([[11, 12], [21, 22], [31, 32]]) for (i,j),v in np.ndenumerate(a): print i, j, v
No, if order in a is 'F' or 'C' , this gives:
0 0 11 0 1 12 1 0 21 1 1 22 2 0 31 2 1 32
Is there a built-in iterator in numpy like ndenumerate to give this (after the array order='F' ):
0 0 11 1 0 21 2 0 31 0 1 12 1 1 22 2 1 32
source share