Skip to content

Commit 311f92e

Browse files
DOC: update copy keyword explanation in astype docstring (#63274)
1 parent 8050f17 commit 311f92e

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

pandas/core/generic.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6354,23 +6354,18 @@ def astype(
63546354
a numpy.dtype or Python type to cast one or more of the DataFrame's
63556355
columns to column-specific types.
63566356
copy : bool, default False
6357-
Return a copy when ``copy=True`` (be very careful setting
6358-
``copy=False`` as changes to values then may propagate to other
6359-
pandas objects).
6357+
This keyword is now ignored; changing its value will have no
6358+
impact on the method.
63606359
6361-
.. note::
6362-
The `copy` keyword will change behavior in pandas 3.0.
6363-
`Copy-on-Write
6364-
<https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html>`__
6365-
will be enabled by default, which means that all methods with a
6366-
`copy` keyword will use a lazy copy mechanism to defer the copy and
6367-
ignore the `copy` keyword. The `copy` keyword will be removed in a
6368-
future version of pandas.
6360+
.. deprecated:: 3.0.0
63696361
6370-
You can already get the future behavior and improvements through
6371-
enabling copy on write ``pd.options.mode.copy_on_write = True``
6362+
This keyword is ignored and will be removed in pandas 4.0. Since
6363+
pandas 3.0, this method always returns a new object using a lazy
6364+
copy mechanism that defers copies until necessary
6365+
(Copy-on-Write). See the `user guide on Copy-on-Write
6366+
<https://pandas.pydata.org/docs/dev/user_guide/copy_on_write.html>`__
6367+
for more details.
63726368
6373-
.. deprecated:: 3.0.0
63746369
errors : {'raise', 'ignore'}, default 'raise'
63756370
Control raising of exceptions on invalid data for provided dtype.
63766371

0 commit comments

Comments
 (0)