[SciPy-User] reading binaries with numpy

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[SciPy-User] reading binaries with numpy

Gabriele Brambilla

I'm trying to read a binary file with fromfile:

import numpy as np

dataline = 1897469

f = open(fname, 'rb')

for iw in range(dataline):
    data = np.fromfile(f , dtype = np.float64 , count = 17)
    alas = data[0]

However, I would like to write a cycle that stops at the eof.
I know that the file has been written with sequences of 17 float.



SciPy-User mailing list
[hidden email]