Skip to content

Commit 453bc26

Browse files
jzwinckjreback
authored andcommitted
DOC: NDFrame.to_hdf(data_columns) documented (#13061).
closes #13061 Author: John Zwinck <[email protected]> Closes #13951 from jzwinck/fix-13061 and squashes the following commits: cfcca2f [John Zwinck] DOC: NDFrame.to_hdf(data_columns) documented (#13061).
1 parent 5c955cb commit 453bc26

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

pandas/core/generic.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -1088,17 +1088,15 @@ def to_json(self, path_or_buf=None, orient=None, date_format='epoch',
10881088
lines=lines)
10891089

10901090
def to_hdf(self, path_or_buf, key, **kwargs):
1091-
"""Activate the HDFStore.
1091+
"""Write the contained data to an HDF5 file using HDFStore.
10921092
10931093
Parameters
10941094
----------
10951095
path_or_buf : the path (string) or HDFStore object
10961096
key : string
10971097
indentifier for the group in the store
1098-
mode : optional, {'a', 'w', 'r', 'r+'}, default 'a'
1098+
mode : optional, {'a', 'w', 'r+'}, default 'a'
10991099
1100-
``'r'``
1101-
Read-only; no data can be modified.
11021100
``'w'``
11031101
Write; a new file is created (an existing file with the same
11041102
name would be deleted).
@@ -1116,6 +1114,11 @@ def to_hdf(self, path_or_buf, key, **kwargs):
11161114
/ selecting subsets of the data
11171115
append : boolean, default False
11181116
For Table formats, append the input data to the existing
1117+
data_columns : list of columns to create as data columns, or True to
1118+
use all columns. See
1119+
`here <http://pandas.pydata.org/pandas-docs/stable/io.html#query-via-data-columns>`__ # noqa
1120+
1121+
Applicable only to format='table'.
11191122
complevel : int, 1-9, default 0
11201123
If a complib is specified compression will be applied
11211124
where possible
@@ -1126,7 +1129,6 @@ def to_hdf(self, path_or_buf, key, **kwargs):
11261129
If applying compression use the fletcher32 checksum
11271130
dropna : boolean, default False.
11281131
If true, ALL nan rows will not be written to store.
1129-
11301132
"""
11311133

11321134
from pandas.io import pytables

pandas/io/pytables.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@ def put(self, key, value, format=None, append=False, **kwargs):
859859
append : boolean, default False
860860
This will force Table format, append the input data to the
861861
existing.
862+
data_columns : list of columns to create as data columns, or True to
863+
use all columns. See
864+
`here <http://pandas.pydata.org/pandas-docs/stable/io.html#query-via-data-columns>`__ # noqa
862865
encoding : default None, provide an encoding for strings
863866
dropna : boolean, default False, do not write an ALL nan row to
864867
the store settable by the option 'io.hdf.dropna_table'
@@ -936,14 +939,16 @@ def append(self, key, value, format=None, append=True, columns=None,
936939
append : boolean, default True, append the input data to the
937940
existing
938941
data_columns : list of columns to create as data columns, or True to
939-
use all columns
942+
use all columns. See
943+
`here <http://pandas.pydata.org/pandas-docs/stable/io.html#query-via-data-columns>`__ # noqa
940944
min_itemsize : dict of columns that specify minimum string sizes
941945
nan_rep : string to use as string nan represenation
942946
chunksize : size to chunk the writing
943947
expectedrows : expected TOTAL row size of this table
944948
encoding : default None, provide an encoding for strings
945949
dropna : boolean, default False, do not write an ALL nan row to
946950
the store settable by the option 'io.hdf.dropna_table'
951+
947952
Notes
948953
-----
949954
Does *not* check if data being appended overlaps with existing

0 commit comments

Comments
 (0)