Skip to content

DOC: append deprecation #45587

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

Merged
merged 10 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from 8 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
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v1.4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
12 changes: 8 additions & 4 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -9013,6 +9013,9 @@ 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
----------
other : DataFrame or Series/dict-like object, or list of these
Expand All @@ -9031,17 +9034,18 @@ 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`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

urgh. this was auto re-wrapped. Can revert for clarity or leave as is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine as long as renders ok

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm seems like the rewarpping didn't work anyway

flake8..........................................................................................................Failed
- hook id: flake8
- exit code: 1

pandas/core/frame.py:9017:89: E501 line too long (116 > 88 characters)
pandas/core/series.py:2884:89: E501 line too long (116 > 88 characters)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine as long as renders ok

yeah it rendered ok, but have reverted anyway


See Also
--------
concat : General function to concatenate DataFrame or Series objects.

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
Expand Down
3 changes: 3 additions & 0 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2880,6 +2880,9 @@ 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
----------
to_append : Series or list/tuple of Series
Expand Down