Skip to content

Commit 3b295c9

Browse files
authored
DOC: Add comment about inplace/copy proposal (#51487)
1 parent 8275e88 commit 3b295c9

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

doc/source/getting_started/comparison/includes/copies.rst

+15
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,18 @@ or overwrite the original one:
1111
.. code-block:: python
1212
1313
df = df.sort_values("col1")
14+
15+
.. note::
16+
17+
You will see an ``inplace=True`` or ``copy=False`` keyword argument available for
18+
some methods:
19+
20+
.. code-block:: python
21+
22+
df.replace(5, inplace=True)
23+
24+
There is an active discussion about deprecating and removing ``inplace`` and ``copy`` for
25+
most methods (e.g. ``dropna``) except for a very small subset of methods
26+
(including ``replace``). Both keywords won't be
27+
necessary anymore in the context of Copy-on-Write. The proposal can be found
28+
[here](https://github.com/pandas-dev/pandas/pull/51466).

doc/source/whatsnew/v2.0.0.rst

+9
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,14 @@ Other API changes
818818
- Added :func:`pandas.api.types.is_any_real_numeric_dtype` to check for real numeric dtypes (:issue:`51152`)
819819
-
820820

821+
.. note::
822+
823+
A current PDEP proposes the deprecation and removal of the keywords ``inplace`` and ``copy``
824+
for all but a small subset of methods from the pandas API. The current discussion takes place
825+
at [here](https://github.com/pandas-dev/pandas/pull/51466). The keywords won't be necessary
826+
anymore in the context of Copy-on-Write. If this proposal is accepted, both
827+
keywords would be deprecated in the next release of pandas and removed in pandas 3.0.
828+
821829
.. ---------------------------------------------------------------------------
822830
.. _whatsnew_200.deprecations:
823831

@@ -1424,6 +1432,7 @@ Metadata
14241432

14251433
Other
14261434
^^^^^
1435+
14271436
- Bug in :meth:`Series.searchsorted` inconsistent behavior when accepting :class:`DataFrame` as parameter ``value`` (:issue:`49620`)
14281437
- Bug in :func:`array` failing to raise on :class:`DataFrame` inputs (:issue:`51167`)
14291438
-

0 commit comments

Comments
 (0)