how to compare and check if two binary(h5) files numerically have the same contents

Heli hemla21 at gmail.com
Tue Nov 21 05:04:45 EST 2017


Dear all, 

I am trying to compare the contents of two binary files. I use python 3.6 filecomp comparing same name files inside two directories.

results_dummy=filecmp.cmpfiles(dir1, dir2, common, shallow=True)

The above line works for *.bin file I have in both directories, but it does not work with h5 files.

When comparing two hdf5 files that contain exactly the same groups/datasets and numerical data, filecmp.cmpfiles finds them as mismatch. My hdf files are not binary equal but contain the same exact data. 

Is there anyway to compare the contents of two hdf5 files from within Python script and without using h5diff?

Thanks in Advance,



More information about the Python-list mailing list