Hi,

I am sorry if this is obvious, but:

I am working on the scipy loadmat module, and would like to use numpy
to reformat the fortran order arrays that matlab saves.  I was not
sure how to do this, and would like to ask for advice.

Let us say that I have some raw binary data as a string.  The data
contains 4 integers, for a 2x2 array, stored in fortran order.

For example, here is 0,1,2,3 as int32

str = '\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00'

What is the best way of me putting this into a 2x2 array object so
that the array recognizes the data is in fortran order.  Sort of:

a = somefunction(str, shape=(2,2), dtype=int32, order='F')

such that a.shape = (2,2) and a[1,0] == 1, rather than 2.

Sorry if that's obvious, but I couldn't see it immediately....

Thanks a lot,

Matthew

-------------------------------------------------------------------------
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

Reply via email to