Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,14 @@ class Series(base.IndexOpsMixin, NDFrame): # type: ignore[misc]
See the :ref:`user guide <basics.dtypes>` for more usages.
name : Hashable, default None
The name to give to the Series.
copy : bool, default False
Copy input data. Only affects Series or 1d ndarray input. See examples.
copy : bool, default None
Copy link
Member Author

@jorisvandenbossche jorisvandenbossche Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to #63144, the question is what to put here in the docstring ..

copy=None is closest to what is in the signature, but is not really meaningful by itself. Of course, the behaviour also depends on the intput, so writing that it defaults to either True or False will also be misleading for some cases.
(eg the current default False in the docstring above is not correct for array input)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with None here, I think the behavior is too complex to give a meaningful description in the space allowed.

Whether to copy input data, only relevant for array, Series, and Index
inputs (for other input, e.g. a list, a new array is created anyway).
Defaults to True for array input and False for Index/Series.
Even when False for Index/Series, a shallow copy of the data is made.
Set to False to avoid copying array input at your own risk (if you
know the input data won't be modified elsewhere).
Set to True to force copying Series/Index input up front.
See Also
--------
Expand Down
Loading