I am trying to read in a very large (several GB) binary with numpy.fromfile (). Reading in the entire file immediately generates an error from memory, so I want to create a loop to read and process N pieces of data at a time. Something like the following:
while True:
numpy.fromfile(f, recordType, N)
if f.EOF():
break
How to determine when I reached the end of a file so that I can break my loop?
source
share