h5py

How to copy a dataset object to a different hdf5 file using pytables or h5py?

孤街浪徒 提交于 2020-08-09 08:00:30
问题 I have selected specific hdf5 datasets and want to copy them to a new hdf5 file. I could find some tutorials on copying between two files, but what if you have just created a new file and you want to copy datasets to the file? I thought the way below would work, but it doesn't. Are there any simple ways to do this? >>> dic_oldDataset['old_dataset'] <HDF5 dataset "old_dataset": shape (333217,), type "|V14"> >>> new_file = h5py.File('new_file.h5', 'a') >>> new_file.create_group('new_group') >>>

How to copy a dataset object to a different hdf5 file using pytables or h5py?

僤鯓⒐⒋嵵緔 提交于 2020-08-09 07:59:51
问题 I have selected specific hdf5 datasets and want to copy them to a new hdf5 file. I could find some tutorials on copying between two files, but what if you have just created a new file and you want to copy datasets to the file? I thought the way below would work, but it doesn't. Are there any simple ways to do this? >>> dic_oldDataset['old_dataset'] <HDF5 dataset "old_dataset": shape (333217,), type "|V14"> >>> new_file = h5py.File('new_file.h5', 'a') >>> new_file.create_group('new_group') >>>