[Numpy-discussion] Reshaing continued

Stephen Walton stephen.walton at csun.edu
Mon Sep 6 09:15:04 CDT 2004


On Sun, 2004-09-05 at 23:26, Karthikesh Raju wrote:

> The transpose was another person's reply to the above question. Actually,
> the reason i was doing all this was because i was working on "a
> dataloader" that allowed me to dump and load variables in a ascii text
> file, similar to what Matlab's mat format does.

I thought as much.  This is an issue the, ahem, older folks on this list
have struggled with since we began migrating some of our code from
Fortran to C/C++.  Fortran and C arrays are column and row major,
respectively.

I think your best solution is to use a well specified, language
independent format for data storage and use the corresponding utilities
to read and write it.  This should solve your problem.  For astronomical
images, my community uses FITS, which carefully specifies the order in
which the values are to be written to disk.  I also learned at SciPy
that HDF and CDF are becoming more widely used.  According to my notes,
PyTables should be able to read and write HDF5 files;  see
http://pytables.sourceforge.net.  Perhaps this can help.

Stephen Walton <stephen.walton at csun.edu>
Dept. of Physics & Astronomy, CSU Northridge
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20040906/3b61b297/attachment-0001.bin 


More information about the Numpy-discussion mailing list