Skip to content

DOC: NDFrame.to_hdf(data_columns) documented (#13061). #13951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,17 +1088,15 @@ def to_json(self, path_or_buf=None, orient=None, date_format='epoch',
lines=lines)

def to_hdf(self, path_or_buf, key, **kwargs):
"""Activate the HDFStore.
"""Write the contained data to an HDF5 file using HDFStore.

Parameters
----------
path_or_buf : the path (string) or HDFStore object
key : string
indentifier for the group in the store
mode : optional, {'a', 'w', 'r', 'r+'}, default 'a'
mode : optional, {'a', 'w', 'r+'}, default 'a'

``'r'``
Read-only; no data can be modified.
``'w'``
Write; a new file is created (an existing file with the same
name would be deleted).
Expand All @@ -1116,6 +1114,9 @@ def to_hdf(self, path_or_buf, key, **kwargs):
/ selecting subsets of the data
append : boolean, default False
For Table formats, append the input data to the existing
data_columns : list of columns to create as data columns, or True to
use all columns. See
`here <http://pandas.pydata.org/pandas-docs/stable/io.html#query-via-data-columns>`__ # noqa
complevel : int, 1-9, default 0
If a complib is specified compression will be applied
where possible
Expand All @@ -1126,7 +1127,6 @@ def to_hdf(self, path_or_buf, key, **kwargs):
If applying compression use the fletcher32 checksum
dropna : boolean, default False.
If true, ALL nan rows will not be written to store.

"""

from pandas.io import pytables
Expand Down
7 changes: 6 additions & 1 deletion pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@ def put(self, key, value, format=None, append=False, **kwargs):
append : boolean, default False
This will force Table format, append the input data to the
existing.
data_columns : list of columns to create as data columns, or True to
use all columns. See
`here <http://pandas.pydata.org/pandas-docs/stable/io.html#query-via-data-columns>`__ # noqa
encoding : default None, provide an encoding for strings
dropna : boolean, default False, do not write an ALL nan row to
the store settable by the option 'io.hdf.dropna_table'
Expand Down Expand Up @@ -936,14 +939,16 @@ def append(self, key, value, format=None, append=True, columns=None,
append : boolean, default True, append the input data to the
existing
data_columns : list of columns to create as data columns, or True to
use all columns
use all columns. See
`here <http://pandas.pydata.org/pandas-docs/stable/io.html#query-via-data-columns>`__ # noqa
min_itemsize : dict of columns that specify minimum string sizes
nan_rep : string to use as string nan represenation
chunksize : size to chunk the writing
expectedrows : expected TOTAL row size of this table
encoding : default None, provide an encoding for strings
dropna : boolean, default False, do not write an ALL nan row to
the store settable by the option 'io.hdf.dropna_table'

Notes
-----
Does *not* check if data being appended overlaps with existing
Expand Down