[Numpy-discussion] Difference in the number of elements in a fromfile() between Windows and Linux

David Cournapeau david at ar.media.kyoto-u.ac.jp
Fri May 4 03:24:15 EDT 2007


Matthieu Brucher wrote:
> Hi,
>
> I'm trying to test my code on several platforms, Windows and Linux, 
> and I'm using some data files that where saved with a tofile(sep=' ') 
> under Linux. Those files can be loaded without a problem under Linux, 
> but under Windows with the latest numpy, these data cannot be loaded, 
> some numbers are not considered - eg +inf or -inf).
tofile is using pickling, right ? If you dump to a text file, there may 
be a problem because of end of line ?
> Is this a known behaviour ? How could I load these correctly under 
> both platforms (I don't want to save them in binary form, I'm using 
> the files for other purpose -
Personally, I always use pytables: the file format (hdf5) is binary, but 
the file format has a standard C api (and C++/java as well), which means 
you can access those files pretty much anywhere, and is designed to be 
cross platform.

David



More information about the NumPy-Discussion mailing list