Re: [Numpy-discussion] Fortran ordering

2010-04-17 Thread Paul Northug
Stéfan van der Walt sun.ac.za> writes: > > On 16 April 2010 21:35, Paul Northug gmail.com> wrote: > > how is it stored in memory, as [1, 2, 3, 4] or [1, 3, 2, 4]? > > The latter: > > In [22]: np.fromstring(str(x.data)) > Out[22]: array([ 1., 3., 2., 4.]) > > > But when I call external lib

Re: [Numpy-discussion] Fortran ordering

2010-04-17 Thread Stéfan van der Walt
On 16 April 2010 21:35, Paul Northug wrote: > how is it stored in memory, as [1, 2, 3, 4] or [1, 3, 2, 4]? The latter: In [22]: np.fromstring(str(x.data)) Out[22]: array([ 1., 3., 2., 4.]) > But when I call external libraries through ctypes with a.ctypes.data > as argument, the external func

Re: [Numpy-discussion] Fortran ordering

2010-04-17 Thread Dag Sverre Seljebotn
Paul Northug wrote: > I'd like to use numpy fortran ordering in order to use some external > libraries more easily, but it looks like I don't understand how it > works and it is causing transposes that are confusing me. > > When I define an array as: > > a = np.array([[1.,2.],[3.,4.]], order='F',

[Numpy-discussion] Fortran ordering

2010-04-16 Thread Paul Northug
I'd like to use numpy fortran ordering in order to use some external libraries more easily, but it looks like I don't understand how it works and it is causing transposes that are confusing me. When I define an array as: a = np.array([[1.,2.],[3.,4.]], order='F', type=np.float32) how is it store