get uniform binary data into array for further processing

chr_w at gmx.de chr_w at gmx.de
Thu Oct 11 04:28:12 EDT 2001


Hi list :-)

I just started coding with python recently and ran into my first major
problem. Ok, here's the story:

I have to import pretty massive binary files containing double-precision
real values (climate data) so I can do some operations to it (mainly
simplyfying, getting the daily some etc.). The file can get really ugly in size... up to
a gig eventually... 

But my main concern:
a) what's the best and fasted way to get this data into a 2-dimensional
array (or list?)?
b) which modul to use (Numeric, array, struct, pickle) ???
c) I have some fortran code which handles this quite good - is there a
similar way to do it in python?

I managed to import a test file of some megs but it took ages and i'm not
sure i did it right, since most values appeared to be 0.0 's... which might be
ok´...?!?

-- 
--------------------------
christian werner  

GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net





More information about the Python-list mailing list