Python 在PyTables表中存储DataFrame而不存储索引
在许多Python 在PyTables表中存储DataFrame而不存储索引,python,pandas,pytables,Python,Pandas,Pytables,在许多DataFrame.to_foo函数中,我可以指定我不想写入索引 >>> help(df.to_csv) Write DataFrame to a comma-separated values (csv) file Parameters ---------- ... index : boolean, default True Write row names (index) ... 数据帧到hdf是否有类似的功能?我不想将索引存储在PyTables表中。您可以
DataFrame.to_foo
函数中,我可以指定我不想写入索引
>>> help(df.to_csv)
Write DataFrame to a comma-separated values (csv) file
Parameters
----------
...
index : boolean, default True
Write row names (index)
...
数据帧到hdf是否有类似的功能?我不想将索引存储在PyTables表中。您可以调用h5py并直接与HDF5交互
data = df.values
with h5py.File('data.h5','w') as f:
f.create_dataset('my_table', data=data)
抑制索引不是熊猫的开箱即用。该问题的跟踪时间为
这不是一个选项;我想可能是的,但无论如何你几乎总是需要它