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
Is this what you are after?
a = np.transpose(np.nonzero(np.ones([32,30]))) a.reshape(32,30,2).transpose(1,0,2).reshape(-1,2) Out[2197]: array([[ 0, 0], [ 1, 0], [ 2, 0], ..., [29, 29], [30, 29], [31, 29]], dtype=int64)