From 1de490702a888c1a58819c783866a9ad5d4fb10e Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Sat, 18 Nov 2023 00:32:41 +0100 Subject: [PATCH] DOC: Add note for copy keywords for Copy-on-Write --- pandas/core/generic.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index e2e81155e1a1d..5cf4210de31ba 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6428,6 +6428,15 @@ def astype( Return a copy when ``copy=True`` (be very careful setting ``copy=False`` as changes to values then may propagate to other pandas objects). + + .. note:: + The copy-keyword will change behavior in pandas 3.0. + `Copy-on-Write + `__ + will be enabled by default, which means that all methods with a + copy-keyword will use a lazy copy mechanism and ignore the copy + keyword. The copy-keyword will be removed in a future version of + pandas. errors : {'raise', 'ignore'}, default 'raise' Control raising of exceptions on invalid data for provided dtype.