Skip to content
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

Merged
merged 4 commits into from
Feb 26, 2020
Merged

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

merged 4 commits into from
Feb 26, 2020

Conversation

asepwhite
Copy link
Contributor

@asepwhite asepwhite commented Feb 15, 2020

################################################################################
######################## 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 if deep 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

@asepwhite asepwhite changed the title Fix pandas.index.copy summary documentation DOC: Fix pandas.index.copy summary documentation Feb 15, 2020
Copy link
Member

@datapythonista datapythonista left a 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.
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"

deep : bool, default False
dtype : numpy dtype or pandas type, optional
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


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

@datapythonista datapythonista merged commit d8115ce into pandas-dev:master Feb 26, 2020
@datapythonista
Copy link
Member

Thanks @asepwhite. If you can please address the review comments in a follow up PR that would be great.

roberthdevries pushed a commit to roberthdevries/pandas that referenced this pull request Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants