Based on what I read on the web, the following seems to be an example of reading data from a binary file consisting of integer data in python:
in_file = open('12345.bin', 'rb');
x = np.fromfile(in_file, dtype = 'int32');
In Matlab, I think the corresponding command is:
in_file = fopen('12345.bin', 'rb');
x = fread(in_file, 'int32');
fclose(in_file);
In Matlab, a file is supposed to be closed using fclose
after finishing using it. Is there anything corresponding to this in NumPy?