Use 'a'
mode to append to the file, and do not name the group the same name as the dataset:
import h5py
with h5py.File('myfile.hdf5','w') as f:
dset = f.create_dataset("MyDataset", (100, 100), 'i')
dset[...] = 42
with h5py.File('myfile.hdf5','r+') as ff:
dset = ff.create_group("MyGroup")