def read_float64_as_float32(filename): x = np.fromfile(filename, np.float64) return x.astype(np.float32)