[Numpy-discussion] Change default order to Fortran order

Sturla Molden sturla.molden at gmail.com
Sun Aug 2 16:22:01 EDT 2015


On 02/08/15 22:14, Kang Wang wrote:
> Thank you all for replying!
>
> I did a quick test, using python 2.6.6, and the original numpy package
> on my Linux computer without any change.
> ==
> x = np.zeros((2,3),dtype=np.int32,order='F')
> print "x.strides ="
> print x.strides
>
> y = x + 1
> print "y.strides ="
> print y.strides
> ==
>
> Output:
> --------
> x.strides =
> (4, 8)
> y.strides =
> (12, 4)
> --------

Update NumPy. This is the behavior I talked about that has changed.

Now NumPy does this:


In [21]: x = np.zeros((2,3),dtype=np.int32,order='F')

In [22]: y = x + 1

In [24]: x.strides
Out[24]: (4, 8)

In [25]: y.strides
Out[25]: (4, 8)



Sturla








More information about the NumPy-Discussion mailing list