-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: update the pandas.Index.duplicated and pandas.Series.duplicated docstring #20117
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: update the pandas.Index.duplicated and pandas.Series.duplicated docstring #20117
Conversation
@TomAugspurger we will have the same discussion here about sharing the docstrings or not |
FWIW I have a slight preference for sharing. Don't have a strong opinion though. |
pandas/core/series.py
Outdated
|
||
See Also | ||
-------- | ||
pandas.Index.duplicated : equivalent method on pandas.Index |
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.
link so Series.drop_duplicates, DataFrame.duplicated
""" | ||
Indicate duplicate index values. | ||
|
||
Duplicated values are indicated as ``True`` values in the resulting |
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.
can you coordinate text with #20114, seems some slight differences
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.
Looks like they are in the zone together already :-)
(they are sitting close to me: we removed the extended summary in the other PR as Tom asked, or are there other differences?)
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.
great, seemed likely.
Ideally I agree that sharing would be nice. |
@jreback does "ideally" mean you are OK with this "practical" solution? :-) As I said in #20114 (comment) as well, in principle we could take out the parameter section as shared part and inject that. But not sure that will be that practical, as the question is then where to put that. |
well ideally this should be much more shared, it ends up being a lot of duplicate text. (this means if we can fix it to make it shared would be the best), but if its too complicated for now, then ok too. |
[ci skip]
Codecov Report
@@ Coverage Diff @@
## master #20117 +/- ##
=========================================
Coverage ? 91.7%
=========================================
Files ? 150
Lines ? 49148
Branches ? 0
=========================================
Hits ? 45070
Misses ? 4078
Partials ? 0
Continue to review full report at Codecov.
|
Thanks @stijnvanhoey |
Checklist for the pandas documentation sprint (ignore this if you are doing
an unrelated PR):
scripts/validate_docstrings.py <your-function-or-method>
git diff upstream/master -u -- "*.py" | flake8 --diff
python doc/make.py --single <your-function-or-method>
Please include the output of the validation script below between the "```" ticks:
Method
pandas.Index.duplicated
:Method
pandas.Series.duplicated
:If the validation script still gives errors, but you think there is a good reason
to deviate in this case (and there are certainly such cases), please state this
explicitly.
Instead of using the template-based version used before, we split out both docstrings and made a separate for the
Index
versus theSeries
. This introduces some redundancy and overlap (basically, thekeep
argument, also shared withdrop_duplicated
), but provides a cleaner option by having the examples written inside the docstring of the methods and not somewhere else in the code.