Hello everyone,
i need to convert a file now is in gz format in hdf5 format.
Someone could help me?
thanks.
Hi Irene,
One approach is that you can import the h5py library. Then, you have to read the file in the gz format and store it in a variable, let’s say arr. To read the file in gz format, you have to import the gzip library. You can read more about it here.
Then you can run the following line of code to convert the file to hdf5 format:
with h5py.File('test.hdf5', 'w') as f: dset = f.create_dataset("default", data = arr)
You can also refer to the above code here.
Thanks,
Bhavika