I\'m using the following code to create a list of indices for an array. However, I would like the index to run in Fortran order i.e. the inner loop being the faster varying
A general solution (that would work for higher dimensional indices e.g. 3D, 4D) etc. seems to be as suggested in the comments by Nils Werner:
points = [32,30] np.transpose(np.nonzero(np.ones(points[::-1])))[:,::-1]
Output:
array([[ 0, 0], [ 1, 0], [ 2, 0], ..., [29, 29], [30, 29], [31, 29]])