Comment utiliser le fichier H5 dans Python
import time
import numpy as np
import h5py
import os
arr = np.random.randn(1000)
with h5py.File('groups.hdf5', 'w') as f:
g = f.create_group('Base_Group')
d = g.create_dataset('default', data=arr)
g.attrs['Date'] = time.time()
g.attrs['User'] = 'Me'
d.attrs['OS'] = os.name
for k in g.attrs.keys():
print('{} => {}'.format(k, g.attrs[k]))
for j in d.attrs.keys():
print('{} => {}'.format(j, d.attrs[j]))
Programmer of empires