[Numpy-discussion] order flag again

Zachary Pincus zpincus at stanford.edu
Mon Mar 27 12:14:56 CST 2006


> The reason for the order flag is that it is needed to interpret  
> what you think a reshape operation should do.   How should the  
> reshape method think the data is stored.  That is the intended  
> meaning of the reshape flag.
> The FORTRAN flag on the array means the strides are actually  
> equivalent to FORTRAN order
> The CONTIGUOUS flag on the array means the strides are actually  
> equilvalent to C-CONTIGUOUS order.
> [...]
> To do what Tim suggests would require the addition of an additional  
> flag (call it the ORDER flag) on the array that would be carried  
> around to tell everybody how to think about this array as a one- 
> dimensional sequence of bytes.
> Such an approach is possible, of course.


Does this mean that if I create a new array with FORTRAN order from  
the numpy.array() function, every time I reshape that array I need to  
tell reshape to use FORTRAN order? That seems a bit odd...

Yet the text above seems to suggests that arrays will not know what  
order their own bytes are in, and thus would need to be told whether  
they should be reshaped like FORTRAN or C memory blocks.

I assume I'm misinterpreting something here?

Zach





More information about the Numpy-discussion mailing list