【发布时间】:2012-10-16 20:42:19
【问题描述】:
这里有一些关于万圣节的熊猫和 HDF 令人毛骨悚然的东西:
df = pandas.DataFrame([['a','b'] for i in range(1,1000)])
store = pandas.HDFStore('test.h5')
store['x'] = df
store.close()
然后
ls -l test.h5
-rw-r--r-- 1 arthur arthur 1072080 Oct 26 10:50 test.h5
110 万?有点陡峭,但为什么不呢。这就是事情变得真正令人毛骨悚然的地方
store = pandas.HDFStore('test.h5') #open it again
store['x'] = df #do the same thing as before!
store.close()
然后
ls -l test.h5
-rw-r--r-- 1 arthur arthur 2122768 Oct 26 10:52 test.h5
您现在已进入暮光区。不用说,运行后store是没有区别的,但是每次迭代都让文件有点胖。
似乎只有在涉及字符串时才会发生。 在我提交错误报告之前,我想知道我是否在这里遗漏了什么......
【问题讨论】: