1

In many DataFrame.to_foo functions I can specify that I don't want to write the index

>>> help(df.to_csv)

Write DataFrame to a comma-separated values (csv) file

Parameters
----------
...
index : boolean, default True
    Write row names (index)
...

Does similar functionality exist for DataFrame.to_hdf? I would like to not store the index in the PyTables table.

MRocklin
  • 55,641
  • 23
  • 163
  • 235
  • 1
    this is not implemented as an option; I suppose it could be but you almost always need it anyhow – Jeff Aug 27 '14 at 00:45

2 Answers2

1

You could call out to h5py and interact with HDF5 directly.

data = df.values
with h5py.File('data.h5','w') as f:
    f.create_dataset('my_table', data=data)
quasiben
  • 1,444
  • 1
  • 11
  • 19
0

Suppressing index is not out of the box with Pandas. The issue is tracked at

https://github.com/pydata/pandas/issues/8319

heroxbd
  • 750
  • 1
  • 7
  • 20