I have a fortran code which produces unformatted files. I wrote a script in python to plot some quantities, and I use the numpy fromfile routine to read the data from the file. In my laptop, which is a MacBook pro with OSX 10.9.1 mavericks, the data are read fine. The piece of the code where it reads the data is as follows:
fileid = open(file,'rb')
hdel = np.fromfile(fileid,dtype='float32',count=1)
probtmp = np.fromfile(fileid,dtype='float64',count=maxptsr*maxptsz)
Now, I want to use it in another machine, a AMD x86_64 linux machine. This machine is x86_64, so I assume that is little-endian as well.
When I read the data I get different numbers. For example, for one value in my laptop I get 2.3892744070368817e-32
, while in the AMD machine I get 2.6284548901535996e-34
.
Does anyone know why I get different numbers? Thank you.