Skip to content

BUG: 0.12.0 using DataFrame.to_hdf() with mode='a' does not append the data #4584

Closed
@bluefir

Description

@bluefir

to_hdf(....., append=True,table=True) raising, should accept this

Is there a way to use DataFrame.to_hdf() so that data can be appened the data? Somehow to_hdf(filename, table_name, mode='a', table=True) overwrites the data while to_hdf(filename, table_name, table=True, append=True) gives the following error:

Traceback (most recent call last):
File "M:/Projects/PortfolioAnalytics/Code/Python/attribution/TopContributors.py", line 1035, in
portfolio_data.to_hdf(filename, OUTPUT_NAME_PORTFOLIO, table=True, append=Settings.TC_OUTPUT_APPEND)
File "C:\Python27\lib\site-packages\pandas\core\generic.py", line 521, in to_hdf
return pytables.to_hdf(path_or_buf, key, self, *_kwargs)
File "C:\Python27\lib\site-packages\pandas\io\pytables.py", line 194, in to_hdf
f(store)
File "C:\Python27\lib\site-packages\pandas\io\pytables.py", line 188, in
f = lambda store: store.append(key, value, *_kwargs)
File "C:\Python27\lib\site-packages\pandas\io\pytables.py", line 658, in append
self._write_to_group(key, value, table=True, append=True, **kwargs)
TypeError: _write_to_group() got multiple values for keyword argument 'table'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions