py Pandas df.to_hdf("test1.h5","t") 呼び出しで生成された HDF5 ファイル test1.h5 があります。ファイルサイズは 27M で、pandas データフレームであるキーは 1 つだけです。
s1 = pd.HDFStore("test1.h5")
<class 'pandas.io.pytables.HDFStore'>
File path: test1.h5
/t frame (shape->[999,2161])
データフレームのほとんどの dtypes は、1 つの int と string を持つ float32 です。
In [21]: s1['/t'].dtypes.value_counts()
Out[21]:
float32 2156
object 3
float64 1
int64 1
dtype: int64
私を悩ませているのは、データフレームを別の HDF5 ファイル test2.h5 に再度保存すると、9.7M しかないことです。
s1['/t'].to_hdf("test2.h5","t")
読み取りと書き込みでサイズが異なる原因は何ですか? ありがとうございました。