From 979e4c03f90b17ceda008dbda99b8de4a612c9ec Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Fri, 5 Nov 2021 20:34:46 -0700 Subject: [PATCH 01/11] DOC: remove min_rows from DataFrame.to_html --- pandas/core/frame.py | 3 +++ pandas/io/formats/format.py | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 4e7f6329bb73b..2ddb72bd28212 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -1078,6 +1078,9 @@ def to_string( %(shared_params)s line_width : int, optional Width to wrap a line in characters. + min_rows : int, optional + The number of rows to display in the console in a truncated repr + (when number of rows is above `max_rows`). max_colwidth : int, optional Max width to truncate each column in characters. By default, no limit. diff --git a/pandas/io/formats/format.py b/pandas/io/formats/format.py index ba85a1b340d05..ca53bfb7d5e08 100644 --- a/pandas/io/formats/format.py +++ b/pandas/io/formats/format.py @@ -164,9 +164,6 @@ * unset. max_rows : int, optional Maximum number of rows to display in the console. - min_rows : int, optional - The number of rows to display in the console in a truncated repr - (when number of rows is above `max_rows`). max_cols : int, optional Maximum number of columns to display in the console. show_dimensions : bool, default False From b6a79294df107844c2315be76022e8cc8788e0e9 Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Fri, 5 Nov 2021 22:27:01 -0700 Subject: [PATCH 02/11] Update for docstring validation --- pandas/core/frame.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 2ddb72bd28212..b97175cc57fd3 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -1065,11 +1065,11 @@ def to_string( index_names: bool = True, justify: str | None = None, max_rows: int | None = None, - min_rows: int | None = None, max_cols: int | None = None, show_dimensions: bool = False, decimal: str = ".", line_width: int | None = None, + min_rows: int | None = None, max_colwidth: int | None = None, encoding: str | None = None, ) -> str | None: @@ -2841,15 +2841,14 @@ def to_html( border : int A ``border=border`` attribute is included in the opening `` tag. Default ``pd.options.display.html.border``. - encoding : str, default "utf-8" - Set character encoding. - - .. versionadded:: 1.0 - table_id : str, optional A css id is included in the opening `
` tag if specified. render_links : bool, default False Convert URLs to HTML links. + encoding : str, default "utf-8" + Set character encoding. + + .. versionadded:: 1.0 %(returns)s See Also -------- From 0829b6ad0af24148b36943f1ef0534e33fb60e4d Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Mon, 15 Nov 2021 20:20:34 -0800 Subject: [PATCH 03/11] Adding change to release note for 1.4 --- doc/source/whatsnew/v1.4.0.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/whatsnew/v1.4.0.rst b/doc/source/whatsnew/v1.4.0.rst index e30e9026e6327..e7e41edad443f 100644 --- a/doc/source/whatsnew/v1.4.0.rst +++ b/doc/source/whatsnew/v1.4.0.rst @@ -730,6 +730,7 @@ Other - Bug in :meth:`Series.to_frame` and :meth:`Index.to_frame` ignoring the ``name`` argument when ``name=None`` is explicitly passed (:issue:`44212`) - Bug in :meth:`Series.replace` and :meth:`DataFrame.replace` with ``value=None`` and ExtensionDtypes (:issue:`44270`) - Bug in :meth:`FloatingArray.equals` failing to consider two arrays equal if they contain ``np.nan`` values (:issue:`44382`) +- Change in the order of the arguments in :meth:`DataFrame.to_string` due to change in the docstring (:issue:`44304`) - .. ***DO NOT USE THIS SECTION*** From b6d0888c07a5b6566e7bf2f33cde59857e97b243 Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Mon, 15 Nov 2021 20:24:12 -0800 Subject: [PATCH 04/11] Adding release note for issue 44304 --- doc/source/whatsnew/v1.4.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.4.0.rst b/doc/source/whatsnew/v1.4.0.rst index e7e41edad443f..b796bb5b8e570 100644 --- a/doc/source/whatsnew/v1.4.0.rst +++ b/doc/source/whatsnew/v1.4.0.rst @@ -211,6 +211,7 @@ Other enhancements - :meth:`.GroupBy.mean` now supports `Numba `_ execution with the ``engine`` keyword (:issue:`43731`) - :meth:`Timestamp.isoformat`, now handles the ``timespec`` argument from the base :class:``datetime`` class (:issue:`26131`) - :meth:`NaT.to_numpy` ``dtype`` argument is now respected, so ``np.timedelta64`` can be returned (:issue:`44460`) +- Change in the order of the arguments in :meth:`DataFrame.to_string` due to change in the docstring (:issue:`44304`) - .. --------------------------------------------------------------------------- @@ -730,7 +731,6 @@ Other - Bug in :meth:`Series.to_frame` and :meth:`Index.to_frame` ignoring the ``name`` argument when ``name=None`` is explicitly passed (:issue:`44212`) - Bug in :meth:`Series.replace` and :meth:`DataFrame.replace` with ``value=None`` and ExtensionDtypes (:issue:`44270`) - Bug in :meth:`FloatingArray.equals` failing to consider two arrays equal if they contain ``np.nan`` values (:issue:`44382`) -- Change in the order of the arguments in :meth:`DataFrame.to_string` due to change in the docstring (:issue:`44304`) - .. ***DO NOT USE THIS SECTION*** From e81712f66adc1f12f00984916c8cff241571a027 Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Wed, 17 Nov 2021 19:58:56 -0800 Subject: [PATCH 05/11] DOC: update whatsnew position of the argument order change --- doc/source/whatsnew/v1.4.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.4.0.rst b/doc/source/whatsnew/v1.4.0.rst index f5b49c0e55c5b..55f6bc6d88a64 100644 --- a/doc/source/whatsnew/v1.4.0.rst +++ b/doc/source/whatsnew/v1.4.0.rst @@ -212,7 +212,6 @@ Other enhancements - :meth:`.GroupBy.mean` now supports `Numba `_ execution with the ``engine`` keyword (:issue:`43731`) - :meth:`Timestamp.isoformat`, now handles the ``timespec`` argument from the base :class:``datetime`` class (:issue:`26131`) - :meth:`NaT.to_numpy` ``dtype`` argument is now respected, so ``np.timedelta64`` can be returned (:issue:`44460`) -- Change in the order of the arguments in :meth:`DataFrame.to_string` due to change in the docstring (:issue:`44304`) - @@ -399,6 +398,7 @@ See :ref:`install.dependencies` and :ref:`install.optional_dependencies` for mor Other API changes ^^^^^^^^^^^^^^^^^ - :meth:`Index.get_indexer_for` no longer accepts keyword arguments (other than 'target'); in the past these would be silently ignored if the index was not unique (:issue:`42310`) +- Change in the position of the `min_rows` in :meth:`DataFrame.to_string` due to change in the docstring (:issue:`44304`) - .. --------------------------------------------------------------------------- From d71041b3cea831075e63f602c618a8c196a1d51f Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Wed, 17 Nov 2021 20:23:30 -0800 Subject: [PATCH 06/11] DOC: making code in double quotes for 44304 --- doc/source/whatsnew/v1.4.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.4.0.rst b/doc/source/whatsnew/v1.4.0.rst index 55f6bc6d88a64..24b719d8e5cda 100644 --- a/doc/source/whatsnew/v1.4.0.rst +++ b/doc/source/whatsnew/v1.4.0.rst @@ -398,7 +398,7 @@ See :ref:`install.dependencies` and :ref:`install.optional_dependencies` for mor Other API changes ^^^^^^^^^^^^^^^^^ - :meth:`Index.get_indexer_for` no longer accepts keyword arguments (other than 'target'); in the past these would be silently ignored if the index was not unique (:issue:`42310`) -- Change in the position of the `min_rows` in :meth:`DataFrame.to_string` due to change in the docstring (:issue:`44304`) +- Change in the position of the ``min_rows`` in :meth:`DataFrame.to_string` due to change in the docstring (:issue:`44304`) - .. --------------------------------------------------------------------------- From e1a5bd1c974c077945e542c6d90ba9e1b495b71a Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Wed, 17 Nov 2021 20:49:28 -0800 Subject: [PATCH 07/11] DOC: add complement to release note --- doc/source/whatsnew/v1.4.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.4.0.rst b/doc/source/whatsnew/v1.4.0.rst index 24b719d8e5cda..2fe289a5f7c35 100644 --- a/doc/source/whatsnew/v1.4.0.rst +++ b/doc/source/whatsnew/v1.4.0.rst @@ -398,7 +398,7 @@ See :ref:`install.dependencies` and :ref:`install.optional_dependencies` for mor Other API changes ^^^^^^^^^^^^^^^^^ - :meth:`Index.get_indexer_for` no longer accepts keyword arguments (other than 'target'); in the past these would be silently ignored if the index was not unique (:issue:`42310`) -- Change in the position of the ``min_rows`` in :meth:`DataFrame.to_string` due to change in the docstring (:issue:`44304`) +- Change in the position of the ``min_rows`` argument in :meth:`DataFrame.to_string` due to change in the docstring (:issue:`44304`) - .. --------------------------------------------------------------------------- From fa30987d303958af79163073811bca6930f6930b Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Thu, 18 Nov 2021 08:02:54 -0800 Subject: [PATCH 08/11] DOC: Update doc v0.9.1 due to error in documentation generation --- doc/source/whatsnew/v0.9.1.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v0.9.1.rst b/doc/source/whatsnew/v0.9.1.rst index 6b05e5bcded7e..2e3ab2b8605a1 100644 --- a/doc/source/whatsnew/v0.9.1.rst +++ b/doc/source/whatsnew/v0.9.1.rst @@ -59,7 +59,7 @@ New features .. ipython:: python - df = DataFrame(np.random.randn(5, 3), columns = ['A','B','C']) + df = pd.DataFrame(np.random.randn(5, 3), columns = ['A','B','C']) df From c2587f807cbaaf16585fa293e9b1ec41cef1b511 Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Thu, 18 Nov 2021 08:13:52 -0800 Subject: [PATCH 09/11] DOC: df.to_html Restore changes in release note --- doc/source/whatsnew/v0.9.1.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v0.9.1.rst b/doc/source/whatsnew/v0.9.1.rst index 2e3ab2b8605a1..6b05e5bcded7e 100644 --- a/doc/source/whatsnew/v0.9.1.rst +++ b/doc/source/whatsnew/v0.9.1.rst @@ -59,7 +59,7 @@ New features .. ipython:: python - df = pd.DataFrame(np.random.randn(5, 3), columns = ['A','B','C']) + df = DataFrame(np.random.randn(5, 3), columns = ['A','B','C']) df From 3e744a684a11b791ab7d04f5103ee3fe93ce1a4f Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Thu, 18 Nov 2021 10:52:12 -0800 Subject: [PATCH 10/11] DOC: changing Dataframe to pd.DataFrame in v0.9.1.rst to avoid build-doc warning --- doc/source/whatsnew/v0.9.1.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v0.9.1.rst b/doc/source/whatsnew/v0.9.1.rst index 6b05e5bcded7e..2e3ab2b8605a1 100644 --- a/doc/source/whatsnew/v0.9.1.rst +++ b/doc/source/whatsnew/v0.9.1.rst @@ -59,7 +59,7 @@ New features .. ipython:: python - df = DataFrame(np.random.randn(5, 3), columns = ['A','B','C']) + df = pd.DataFrame(np.random.randn(5, 3), columns = ['A','B','C']) df From 5e2ea4bee2b46808fe9f42f99af6ce07f2cdfbfb Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Thu, 18 Nov 2021 18:15:13 -0800 Subject: [PATCH 11/11] DOC: df.to_html revert changes in previous CI error --- doc/source/whatsnew/v0.9.1.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v0.9.1.rst b/doc/source/whatsnew/v0.9.1.rst index 2e3ab2b8605a1..6b05e5bcded7e 100644 --- a/doc/source/whatsnew/v0.9.1.rst +++ b/doc/source/whatsnew/v0.9.1.rst @@ -59,7 +59,7 @@ New features .. ipython:: python - df = pd.DataFrame(np.random.randn(5, 3), columns = ['A','B','C']) + df = DataFrame(np.random.randn(5, 3), columns = ['A','B','C']) df