The NumPy Fortran-ordering quiz

Charles R Harris charlesr.harris at gmail.com
Tue Oct 17 20:47:22 CDT 2006


On 10/17/06, Lisandro Dalcin <dalcinl at gmail.com> 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.

In [15]: array([1,2,3,4,5,6]).reshape((3,2),order='F')
> Out[15]:
> array([[1, 2],
>        [3, 4],
>        [5, 6]])



 This one is fixed,

In [3]: array([[1,2,3,4,5,6]]).reshape((3,2),order='F')
Out[3]:
array([[1, 4],
       [2, 5],
       [3, 6]])

I also don't understand why a copy is returned if 'F' just fiddles with the
indices and strides; the underlying data should be the same, just the view
changes. FWIW, I think both examples should be returning views.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20061017/d0a27252/attachment.html 
-------------- next part --------------
-------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


More information about the Numpy-discussion mailing list