Release hdf5 disk memory after table or node deletion using pytables or pandas

I am using HDFStore with pandas / pytables.

After deleting the table or object, the hdf5 file size remains unchanged. This space seems to be reused when additional objects are added for storage, but this can be a problem if large space is wasted.

I did not find any command in pandas and pytables APIs that can be used to recover hdf5 memory.

Do you know any mechanism to improve data management in hdf5 files?

+3
source share
1 answer

see here

you need ptrepack it, which overwrites the file.

 ptrepack --chunkshape=auto --propindexes --complevel=9 --complib=blosc in.h5 out.h5 

as an example (this also compresses the file).

+8
source

Source: https://habr.com/ru/post/1233609/


All Articles