Skip to content

Commit 4cd6d7e

Browse files
authored
DOC: Add note for copy keywords for Copy-on-Write (#56033)
1 parent 325e04c commit 4cd6d7e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pandas/core/generic.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6429,6 +6429,18 @@ def astype(
64296429
Return a copy when ``copy=True`` (be very careful setting
64306430
``copy=False`` as changes to values then may propagate to other
64316431
pandas objects).
6432+
6433+
.. note::
6434+
The `copy` keyword will change behavior in pandas 3.0.
6435+
`Copy-on-Write
6436+
<https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html>`__
6437+
will be enabled by default, which means that all methods with a
6438+
`copy` keyword will use a lazy copy mechanism to defer the copy and
6439+
ignore the `copy` keyword. The `copy` keyword will be removed in a
6440+
future version of pandas.
6441+
6442+
You can already get the future behavior and improvements through
6443+
enabling copy on write ``pd.options.mode.copy_on_write = True``
64326444
errors : {'raise', 'ignore'}, default 'raise'
64336445
Control raising of exceptions on invalid data for provided dtype.
64346446

0 commit comments

Comments
 (0)