-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
DOC: Fix pandas.index.copy summary documentation #32006
DOC: Fix pandas.index.copy summary documentation #32006
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @asepwhite !
In a follow up you can replace Label
by label
as the type, and add the description to deep
if you want.
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. |
There was a problem hiding this comment.
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"
deep : bool, default False | ||
dtype : numpy dtype or pandas type, optional | ||
Set dtype for new object. |
There was a problem hiding this comment.
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
|
||
Parameters | ||
---------- | ||
name : Label | ||
name : Label, optional | ||
Set name for new object. | ||
deep : bool, default False | ||
dtype : numpy dtype or pandas type, optional |
There was a problem hiding this comment.
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
Thanks @asepwhite. If you can please address the review comments in a follow up PR that would be great. |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Output of
python scripts/validate_docstrings.py pandas.Index.copy
################################################################################
######################## Docstring (pandas.Index.copy) ########################
################################################################################
Make a copy of this object.
Name and dtype sets those attributes on the new object.
Parameters
name : Label, optional
Set name for new object.
deep : bool, default False
dtype : numpy dtype or pandas type, optional
Set dtype for new object.
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.
Notes
In most cases, there should be no functional difference from using
deep
, but ifdeep
is passed it will attempt to deepcopy.################################################################################
################################## Validation ##################################
################################################################################
3 Errors found:
Parameter "deep" has no description
See Also section not found
No examples section found