From e93958a4c23ccb48ac43ce5e12eb5438b73ceab0 Mon Sep 17 00:00:00 2001 From: Gesa-Maret Neitzert Date: Mon, 24 Jan 2022 12:22:51 +0100 Subject: [PATCH 1/9] DOC GH44539 --- pandas/core/frame.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 36e698fa576d8..6566843c1972a 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8936,6 +8936,10 @@ def append( Columns in `other` that are not in the caller are added as new columns. + .. deprecated:: 1.4.0 + append is deprecated, + use DataFrame/Series.concat instead. + Parameters ---------- other : DataFrame or Series/dict-like object, or list of these From d05c5b72624eca48d85916d09dbe306774da82f8 Mon Sep 17 00:00:00 2001 From: Gesa-Maret Neitzert Date: Tue, 25 Jan 2022 11:35:25 +0100 Subject: [PATCH 2/9] corrected replacement --- pandas/core/frame.py | 2 +- pandas/core/series.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 6566843c1972a..db20c2a75fbfe 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8938,7 +8938,7 @@ def append( .. deprecated:: 1.4.0 append is deprecated, - use DataFrame/Series.concat instead. + use pandas.concat instead. Parameters ---------- diff --git a/pandas/core/series.py b/pandas/core/series.py index c0080789a277b..6ea3c246b4ccd 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2865,6 +2865,10 @@ def append( """ Concatenate two or more Series. + .. deprecated:: 1.4.0 + append is deprecated, + use pandas.concat instead. + Parameters ---------- to_append : Series or list/tuple of Series From 06e03fe11f0edb18d2c2dde1a29dc7b0f8bbfb10 Mon Sep 17 00:00:00 2001 From: Gesa-Maret Neitzert Date: Mon, 31 Jan 2022 21:46:30 +0100 Subject: [PATCH 3/9] Updated doc string --- pandas/core/frame.py | 7 +++++-- pandas/core/series.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index db20c2a75fbfe..7c88ade83f57d 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8937,8 +8937,11 @@ def append( Columns in `other` that are not in the caller are added as new columns. .. deprecated:: 1.4.0 - append is deprecated, - use pandas.concat instead. + ``DataFrame.append`` is deprecated, + use ``pandas.concat`` instead. + For further details see + :ref:`Deprecated Frame.append and Series.append + `. Parameters ---------- diff --git a/pandas/core/series.py b/pandas/core/series.py index 6ea3c246b4ccd..e96f3f74a818e 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2866,8 +2866,11 @@ def append( Concatenate two or more Series. .. deprecated:: 1.4.0 - append is deprecated, - use pandas.concat instead. + ``Series.append`` is deprecated, + use ``pandas.concat`` instead. + For further details see + :ref:`Deprecated Frame.append and Series.append + `. Parameters ---------- From 131d0ee7468fb3d35b22a88ec38d7f42baeb4245 Mon Sep 17 00:00:00 2001 From: Gesa-Maret Neitzert Date: Tue, 1 Feb 2022 08:55:33 +0100 Subject: [PATCH 4/9] Updated doc string --- pandas/core/frame.py | 5 ++--- pandas/core/series.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 7c88ade83f57d..df17f002360c0 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8939,9 +8939,8 @@ def append( .. deprecated:: 1.4.0 ``DataFrame.append`` is deprecated, use ``pandas.concat`` instead. - For further details see - :ref:`Deprecated Frame.append and Series.append - `. + For further details see section *Deprecated Frame.append and Series.append* in the What's new or + *Merge, join, concatenate and compare* in the User Guide. Parameters ---------- diff --git a/pandas/core/series.py b/pandas/core/series.py index e96f3f74a818e..1cf5e6a0a7cce 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2868,9 +2868,8 @@ def append( .. deprecated:: 1.4.0 ``Series.append`` is deprecated, use ``pandas.concat`` instead. - For further details see - :ref:`Deprecated Frame.append and Series.append - `. + For further details see section *Deprecated Frame.append and Series.append* in the What's new or + *Merge, join, concatenate and compare* in the User Guide. Parameters ---------- From 0cec30c8b5543acd3add60b0fc7d97b930db883d Mon Sep 17 00:00:00 2001 From: Gesa-Maret Neitzert Date: Tue, 1 Feb 2022 08:57:07 +0100 Subject: [PATCH 5/9] Updated doc string --- pandas/core/frame.py | 3 ++- pandas/core/series.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index df17f002360c0..f1fd317b1b869 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8939,7 +8939,8 @@ def append( .. deprecated:: 1.4.0 ``DataFrame.append`` is deprecated, use ``pandas.concat`` instead. - For further details see section *Deprecated Frame.append and Series.append* in the What's new or + For further details see section *Deprecated Frame.append and Series.append* + in the What's new or *Merge, join, concatenate and compare* in the User Guide. Parameters diff --git a/pandas/core/series.py b/pandas/core/series.py index 1cf5e6a0a7cce..b3c23a73a44db 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2868,7 +2868,8 @@ def append( .. deprecated:: 1.4.0 ``Series.append`` is deprecated, use ``pandas.concat`` instead. - For further details see section *Deprecated Frame.append and Series.append* in the What's new or + For further details see section *Deprecated Frame.append and Series.append* + in the What's new or *Merge, join, concatenate and compare* in the User Guide. Parameters From 541d5e9656598e08d2faf3ec527a0a8be12a9f2e Mon Sep 17 00:00:00 2001 From: gesoos Date: Wed, 9 Feb 2022 17:17:16 +0100 Subject: [PATCH 6/9] Simplified deprecated in docstring --- pandas/core/frame.py | 5 ----- pandas/core/series.py | 5 ----- 2 files changed, 10 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index f1fd317b1b869..cab78ff2a8067 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8937,11 +8937,6 @@ def append( Columns in `other` that are not in the caller are added as new columns. .. deprecated:: 1.4.0 - ``DataFrame.append`` is deprecated, - use ``pandas.concat`` instead. - For further details see section *Deprecated Frame.append and Series.append* - in the What's new or - *Merge, join, concatenate and compare* in the User Guide. Parameters ---------- diff --git a/pandas/core/series.py b/pandas/core/series.py index b3c23a73a44db..e298c4c9fc6bb 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2866,11 +2866,6 @@ def append( Concatenate two or more Series. .. deprecated:: 1.4.0 - ``Series.append`` is deprecated, - use ``pandas.concat`` instead. - For further details see section *Deprecated Frame.append and Series.append* - in the What's new or - *Merge, join, concatenate and compare* in the User Guide. Parameters ---------- From 6f4b9fbbfeb285937a4c0feac9f3f0edd0c36538 Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Fri, 11 Feb 2022 11:37:36 +0000 Subject: [PATCH 7/9] add one-liner --- doc/source/whatsnew/v1.4.0.rst | 2 +- pandas/core/frame.py | 10 ++++++---- pandas/core/series.py | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/source/whatsnew/v1.4.0.rst b/doc/source/whatsnew/v1.4.0.rst index 47a087d38d146..fbc500087f57e 100644 --- a/doc/source/whatsnew/v1.4.0.rst +++ b/doc/source/whatsnew/v1.4.0.rst @@ -641,7 +641,7 @@ Deprecated Frame.append and Series.append ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :meth:`DataFrame.append` and :meth:`Series.append` have been deprecated and will -be removed in Pandas 2.0. Use :func:`pandas.concat` instead (:issue:`35407`). +be removed in a future version. Use :func:`pandas.concat` instead (:issue:`35407`). *Deprecated syntax* diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 6440a10bcd0ff..f4af1c261c3e2 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -9014,6 +9014,7 @@ def append( Columns in `other` that are not in the caller are added as new columns. .. deprecated:: 1.4.0 + Use :func:`concat` instead. For further details see :ref:`whatsnew_140.deprecations.frame_series_append` Parameters ---------- @@ -9033,7 +9034,8 @@ def append( Returns ------- DataFrame - A new DataFrame consisting of the rows of caller and the rows of `other`. + A new DataFrame consisting of the rows of caller and the rows of + `other`. See Also -------- @@ -9041,9 +9043,9 @@ def append( Notes ----- - If a list of dict/series is passed and the keys are all contained in - the DataFrame's index, the order of the columns in the resulting - DataFrame will be unchanged. + If a list of dict/series is passed and the keys are all contained in the + DataFrame's index, the order of the columns in the resulting DataFrame + will be unchanged. Iteratively appending rows to a DataFrame can be more computationally intensive than a single concatenate. A better solution is to append diff --git a/pandas/core/series.py b/pandas/core/series.py index d51cf21863e72..fc5948be3f545 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2881,6 +2881,7 @@ def append( Concatenate two or more Series. .. deprecated:: 1.4.0 + Use :func:`concat` instead. For further details see :ref:`whatsnew_140.deprecations.frame_series_append` Parameters ---------- From 26cfee150057dd3c84e6a528e2eb5162c4c0042a Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Fri, 11 Feb 2022 11:50:33 +0000 Subject: [PATCH 8/9] flake8 fixup --- pandas/core/frame.py | 12 ++++++------ pandas/core/series.py | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index f4af1c261c3e2..9a72ff95a43be 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -9014,7 +9014,8 @@ def append( Columns in `other` that are not in the caller are added as new columns. .. deprecated:: 1.4.0 - Use :func:`concat` instead. For further details see :ref:`whatsnew_140.deprecations.frame_series_append` + Use :func:`concat` instead. For further details see + :ref:`whatsnew_140.deprecations.frame_series_append` Parameters ---------- @@ -9034,8 +9035,7 @@ def append( Returns ------- DataFrame - A new DataFrame consisting of the rows of caller and the rows of - `other`. + A new DataFrame consisting of the rows of caller and the rows of `other`. See Also -------- @@ -9043,9 +9043,9 @@ def append( Notes ----- - If a list of dict/series is passed and the keys are all contained in the - DataFrame's index, the order of the columns in the resulting DataFrame - will be unchanged. + If a list of dict/series is passed and the keys are all contained in + the DataFrame's index, the order of the columns in the resulting + DataFrame will be unchanged. Iteratively appending rows to a DataFrame can be more computationally intensive than a single concatenate. A better solution is to append diff --git a/pandas/core/series.py b/pandas/core/series.py index fc5948be3f545..ea80f9d1ea04e 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2881,7 +2881,8 @@ def append( Concatenate two or more Series. .. deprecated:: 1.4.0 - Use :func:`concat` instead. For further details see :ref:`whatsnew_140.deprecations.frame_series_append` + Use :func:`concat` instead. For further details see + :ref:`whatsnew_140.deprecations.frame_series_append` Parameters ---------- From 8e55b935acc4798d0466a7e4d957e1a62b225eb4 Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Fri, 11 Feb 2022 12:24:05 +0000 Subject: [PATCH 9/9] move above extended summary --- doc/source/whatsnew/v1.4.0.rst | 4 ++-- pandas/core/frame.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/whatsnew/v1.4.0.rst b/doc/source/whatsnew/v1.4.0.rst index fbc500087f57e..7340f2475e1f6 100644 --- a/doc/source/whatsnew/v1.4.0.rst +++ b/doc/source/whatsnew/v1.4.0.rst @@ -637,8 +637,8 @@ will continue to return :class:`Int64Index`, :class:`UInt64Index` and .. _whatsnew_140.deprecations.frame_series_append: -Deprecated Frame.append and Series.append -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Deprecated DataFrame.append and Series.append +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :meth:`DataFrame.append` and :meth:`Series.append` have been deprecated and will be removed in a future version. Use :func:`pandas.concat` instead (:issue:`35407`). diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 9a72ff95a43be..082a5814c2fc7 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -9011,12 +9011,12 @@ def append( """ Append rows of `other` to the end of caller, returning a new object. - Columns in `other` that are not in the caller are added as new columns. - .. deprecated:: 1.4.0 Use :func:`concat` instead. For further details see :ref:`whatsnew_140.deprecations.frame_series_append` + Columns in `other` that are not in the caller are added as new columns. + Parameters ---------- other : DataFrame or Series/dict-like object, or list of these