Skip to content

DOC: Fix pandas.index.copy summary documentation #32006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 26, 2020
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: 7 additions & 3 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,20 +825,24 @@ def repeat(self, repeats, axis=None):

def copy(self, name=None, deep=False, dtype=None, names=None):
"""
Make a copy of this object. Name and dtype sets those attributes on
the new object.
Make a copy of this object.

Name and dtype sets those attributes on the new object.

Parameters
----------
name : Label
name : Label, optional
Set name for new object.
deep : bool, default False
dtype : numpy dtype or pandas type, optional
Copy link
Member

Choose a reason for hiding this comment

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

"pandas type" isnt a thing, possibly "ExtensionDType"? i think strs are also accepted if they can be mapped to dtypes

Set dtype for new object.
Copy link
Member

Choose a reason for hiding this comment

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

"Set" her and on 835 are unnecessary

names : list-like, optional
Kept for compatibility with MultiIndex. Should not be used.

Returns
-------
Index
Index refer to new object which is a copy of this object.
Copy link
Member

Choose a reason for hiding this comment

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

less verbose here: "New Index object"


Notes
-----
Expand Down