Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Release hdf5 disk memory after table or node removal with pytables or pandas

I'm using HDFStore with pandas / pytables.

After removing a table or object, hdf5 file size remains unaffected. It seems this space is reused afterwards when additional objects are added to store, but it can be an issue if large space is wasted.

I have not found any command in pandas nor pytables APIs that might be used to recover hdf5 memory.

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

like image 899
jruizaranguren Avatar asked Jan 13 '14 11:01

jruizaranguren


1 Answers

see here

you need to ptrepack it, which rewrites the file.

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

as an example (this will also compress the file).

like image 177
Jeff Avatar answered Nov 14 '22 22:11

Jeff