H5py adding more data to an existing dataset


#1

My question is i create a h5py file, in python create my dataset and write my data to the dataset in the file then close the file this is the part i cant figure out how to do can i open back the file and continue to write more data to the existing dataset without overwriting and losing my existing data in my dataset


#2

You’ll need to use the 'r+' or 'a' mode when you reopen the file, to get read/write access without replacing the existing data. Docs: http://docs.h5py.org/en/stable/high/file.html#opening-creating-files

If you left empty space in your dataset when you first wrote to it, you can write to that as per normal (dataset[x:y] = data). If not, you will need to resize the dataset to make room for your new data. Docs: http://docs.h5py.org/en/stable/high/dataset.html#resizable-datasets


#3

Thank you very much fore the advice

I’ll give it a try and I hope if I have any more questions I can ask you .