On 10/17/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
Why a Fortran ravel? I am thinking of it as preserving the memory layout, just messing with how it is addressed.
Chuck
Charles R Harris wrote:
>
>
> On 10/17/06, *Lisandro Dalcin* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> I was surprised by this
>
> In [14]: array([[1,2,3],[4,5,6]]).reshape((3,2),order='F')
> Out[14]:
> array([[1, 5],
> [4, 3],
> [2, 6]])
>
>
> This one still looks wrong.
Why does this look wrong. What do you want it to be? Perhaps you are
thinking about the input array as C-order and the output array as
Fortran order. That's not what reshape does. The order argument
specifies how you think about both the input and output.
Thus, reshape does the equivalent of a Fortran ravel to [1,4,2,5,3,6]
and then a Fortran-order based fill of an empty (3,2) array: giving you
the result.
Why a Fortran ravel? I am thinking of it as preserving the memory layout, just messing with how it is addressed.
Chuck
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion