Skip to content

Commit 4ade1d0

Browse files
committed
DOC: Correct typing of 'copy' argument in astype docstring (#63144)
1 parent 4d83483 commit 4ade1d0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pandas/core/generic.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6340,10 +6340,12 @@ def astype(
63406340
mapping, e.g. {col: dtype, ...}, where col is a column label and dtype is
63416341
a numpy.dtype or Python type to cast one or more of the DataFrame's
63426342
columns to column-specific types.
6343-
copy : bool, default False
6344-
Return a copy when ``copy=True`` (be very careful setting
6345-
``copy=False`` as changes to values then may propagate to other
6346-
pandas objects).
6343+
copy : bool or None, default None
6344+
Whether to copy the data or not.
6345+
6346+
- True : always return a new object.
6347+
- False : try to avoid copying and return a view if possible.
6348+
- None : use the default lazy-copy behavior (recommended).
63476349
63486350
.. note::
63496351
The `copy` keyword will change behavior in pandas 3.0.

0 commit comments

Comments
 (0)