【问题标题】:Release hdf5 disk memory after table or node removal with pytables or pandas使用 pytables 或 pandas 删除表或节点后释放 hdf5 磁盘内存
【发布时间】:2014-02-01 03:17:27
【问题描述】:

我将 HDFStore 与 pandas / pytables 一起使用。

删除表或对象后,hdf5 文件大小不受影响。当额外的对象被添加到存储时,这个空间似乎会被重用,但如果浪费大空间,这可能是一个问题。

我在 pandas 或 pytables API 中没有找到任何可用于恢复 hdf5 内存的命令。

您知道任何改进 hdf5 文件数据管理的机制吗?

【问题讨论】:

    标签: python pandas hdf5 pytables


    【解决方案1】:

    here

    你需要ptrepack它,它会重写文件。

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

    作为一个例子(这也会压缩文件)。

    【讨论】:

    • 有没有办法从 pytables 或 pandas API 调用 ptrepack?
    • @user3645626,我找不到。我做了 subprocess.call 来发出ptrepack 实用程序: call(["ptrepack", "-o", "--chunkshape=auto", "--propindexes", --complevel=9", "-- complib=blosc",infilename, outfilename])。我很想知道是否有其他方法。
    猜你喜欢
    • 2021-08-09
    • 2019-01-15
    • 2016-11-22
    • 2016-10-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多