From 9e302060974e2ad2ab4923e3e99f68839da6d8b5 Mon Sep 17 00:00:00 2001 From: alexondor Date: Tue, 3 May 2022 01:09:48 +0300 Subject: [PATCH 1/2] DOC: added index, dropna description for HDF methods #45030 --- pandas/core/generic.py | 4 ++++ pandas/io/pytables.py | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index c615216240d60..c87dd0cdfcf55 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2599,6 +2599,8 @@ def to_hdf( like searching / selecting subsets of the data. - If None, pd.get_option('io.hdf.default_format') is checked, followed by fallback to "fixed". + index : bool, default True + Write DataFrame index as a column errors : str, default 'strict' Specifies how encoding and decoding errors are to be handled. See the errors argument for :func:`open` for a full list @@ -2609,6 +2611,8 @@ def to_hdf( nan_rep : Any, optional How to represent null values as str. Not allowed with append=True. + dropna : bool, default False, optional + Remove missing values data_columns : list of columns or True, optional List of columns to create as indexed data columns for on-disk queries, or True to use all columns. By default only the axes diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 505f5a74f06e6..1d4f3f355455c 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1112,6 +1112,8 @@ def put( Table format. Write as a PyTables Table structure which may perform worse but allow more flexible operations like searching / selecting subsets of the data. + index : bool, default True + Write DataFrame index as a column append : bool, default False This will force Table format, append the input data to the existing. data_columns : list of columns or True, default None @@ -1124,6 +1126,8 @@ def put( Parameter is propagated to 'create_table' method of 'PyTables'. If set to False it enables to have the same h5 files (same hashes) independent on creation time. + dropna : bool, default False, optional + Remove missing values .. versionadded:: 1.1.0 """ @@ -1239,6 +1243,8 @@ def append( Table format. Write as a PyTables Table structure which may perform worse but allow more flexible operations like searching / selecting subsets of the data. + index : bool, default True + Write DataFrame index as a column append : bool, default True Append the input data to the existing. data_columns : list of columns, or True, default None @@ -1251,7 +1257,7 @@ def append( chunksize : size to chunk the writing expectedrows : expected TOTAL row size of this table encoding : default None, provide an encoding for str - dropna : bool, default False + dropna : bool, default False, optional Do not write an ALL nan row to the store settable by the option 'io.hdf.dropna_table'. From 23da5ce9f2c5e65809e756333a5213a0a1e7bc0a Mon Sep 17 00:00:00 2001 From: alexondor Date: Tue, 3 May 2022 01:40:32 +0300 Subject: [PATCH 2/2] DOC: added index, dropna description for HDF methods #45030 --- pandas/core/generic.py | 4 ++-- pandas/io/pytables.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index c87dd0cdfcf55..13af64c9fea5d 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2600,7 +2600,7 @@ def to_hdf( - If None, pd.get_option('io.hdf.default_format') is checked, followed by fallback to "fixed". index : bool, default True - Write DataFrame index as a column + Write DataFrame index as a column. errors : str, default 'strict' Specifies how encoding and decoding errors are to be handled. See the errors argument for :func:`open` for a full list @@ -2612,7 +2612,7 @@ def to_hdf( How to represent null values as str. Not allowed with append=True. dropna : bool, default False, optional - Remove missing values + Remove missing values. data_columns : list of columns or True, optional List of columns to create as indexed data columns for on-disk queries, or True to use all columns. By default only the axes diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 1d4f3f355455c..fc9671c2fc973 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1113,7 +1113,7 @@ def put( worse but allow more flexible operations like searching / selecting subsets of the data. index : bool, default True - Write DataFrame index as a column + Write DataFrame index as a column. append : bool, default False This will force Table format, append the input data to the existing. data_columns : list of columns or True, default None @@ -1127,7 +1127,7 @@ def put( If set to False it enables to have the same h5 files (same hashes) independent on creation time. dropna : bool, default False, optional - Remove missing values + Remove missing values. .. versionadded:: 1.1.0 """ @@ -1244,7 +1244,7 @@ def append( worse but allow more flexible operations like searching / selecting subsets of the data. index : bool, default True - Write DataFrame index as a column + Write DataFrame index as a column. append : bool, default True Append the input data to the existing. data_columns : list of columns, or True, default None