thunderbird
thunderbird

Reputation: 1

Numpy fromfile io.UnsupportedOperation

When I try to read from a binary file using numpy.fromfile, I get an error message saying io.UnsupportedOperation: seek

I am using Python 3.7.1

with open(filename, 'rb') as fin:
    prolog = np.fromfile(fin, dtype=np.int32, count=15)

Upvotes: 0

Views: 704

Answers (1)

John Zwinck
John Zwinck

Reputation: 249462

This is simpler and should definitely work:

prolog = np.fromfile(filename, dtype=np.int32, count=15)

Upvotes: 1

Related Questions