[Numpy-discussion] Proposal of new function: iteraxis()

Matthew Brett matthew.brett@gmail....
Fri Apr 26 15:45:38 CDT 2013


On Fri, Apr 26, 2013 at 10:02 AM, Andrew Giessel
<andrew_giessel@hms.harvard.edu> wrote:
> I like this, thank you Phil.
> From what I can see, the ordering of the returned slices when you use more
> than one axis (ie: slices(a, [1,2]), increments the last axis fastest.  Does
> this makes sense based on the default ordering of, say, nditer()?  I know
> that C-order (row major) and Fortran order (column major) are two ways of
> ordering the returned values- which does this default to? Is there a default
> across numpy?

There was a thread on the distinction between index ordering and
memory layout starting here:


The answer is that C-like index ordering is the default across numpy
(last changing fastest), and that, typically (always?) you can change
this ordering to Fortran-like (first-fastest) with an 'order' keyword
to the function or method.



More information about the NumPy-Discussion mailing list