diff --git a/pandas/core/generic.py b/pandas/core/generic.py index ea133e9a83adb..869a8163694d5 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6354,23 +6354,15 @@ def astype( a numpy.dtype or Python type to cast one or more of the DataFrame's columns to column-specific types. copy : bool, default False - Return a copy when ``copy=True`` (be very careful setting - ``copy=False`` as changes to values then may propagate to other - pandas objects). + .. deprecated:: 3.0.0 - .. note:: - The `copy` keyword will change behavior in pandas 3.0. - `Copy-on-Write + This keyword is ignored and will be removed in pandas 4.0. Since + pandas 3.0, this method always returns a new object using a lazy + copy mechanism that defers copies until necessary + (Copy-on-Write). See the `user guide on Copy-on-Write `__ - will be enabled by default, which means that all methods with a - `copy` keyword will use a lazy copy mechanism to defer the copy and - ignore the `copy` keyword. The `copy` keyword will be removed in a - future version of pandas. - - You can already get the future behavior and improvements through - enabling copy on write ``pd.options.mode.copy_on_write = True`` + for more details. - .. deprecated:: 3.0.0 errors : {'raise', 'ignore'}, default 'raise' Control raising of exceptions on invalid data for provided dtype.