Skip to content

Commit 1c08a93

Browse files
DOC: update Series() docstring about copy behaviour (#63341)
Co-authored-by: Richard Shadrach <[email protected]>
1 parent 6e678e3 commit 1c08a93

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pandas/core/series.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,14 @@ class Series(base.IndexOpsMixin, NDFrame): # type: ignore[misc]
265265
See the :ref:`user guide <basics.dtypes>` for more usages.
266266
name : Hashable, default None
267267
The name to give to the Series.
268-
copy : bool, default False
269-
Copy input data. Only affects Series or 1d ndarray input. See examples.
268+
copy : bool, default None
269+
Whether to copy input data, only relevant for array, Series, and Index
270+
inputs (for other input, e.g. a list, a new array is created anyway).
271+
Defaults to True for array input and False for Index/Series.
272+
Even when False for Index/Series, a shallow copy of the data is made.
273+
Set to False to avoid copying array input at your own risk (if you
274+
know the input data won't be modified elsewhere).
275+
Set to True to force copying Series/Index input up front.
270276
271277
See Also
272278
--------

0 commit comments

Comments
 (0)