What does Fortran order mean?

Travis Oliphant oliphant at ee.byu.edu
Tue Oct 17 11:01:51 CDT 2006

Charles R Harris wrote:

> Travis,
> I note that
> >>> a = arange(6).reshape(2,3,order='F')
> >>> a
> array([[0, 1, 2],
>        [3, 4, 5]])
> Shouldn't that be 3x2? Or maybe [[0,2,4],[1,3,5]]? Reshape is making a 
> copy, but flat, flatten, and tostring all show the elements in 'C' 
> order. I ask because I wonder if changing the order can be used to 
> prepare arrays for input into the LaPack routines.

The order argument to reshape means (how should the big-chunk of data be 
interpreted when you reshape).  So, yes, this should be 
[[0,2,4],[1,3,5]].  It is a bug that it does not do the right thing in 
this case.

I've committed a fix to SVN and a test for this case.


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

More information about the Numpy-discussion mailing list