-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
DOC: update the pandas.Series.add_suffix docstring #20315
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
Conversation
|
Same comments as in #20313 :) |
|
Docstring fixed. :) |
datapythonista
left a comment
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.
Didn't check, but as this is defined in generic.py it's likely to be reused by both Series and DataFrame. Can you build the whole documentation and check the page for DataFrame.add_sufix please? If it says that it returns a Series, and all the other stuff specific to Series it should be changed, so both pages are correct.
Codecov Report
@@ Coverage Diff @@
## master #20315 +/- ##
=========================================
Coverage ? 91.73%
=========================================
Files ? 150
Lines ? 49174
Branches ? 0
=========================================
Hits ? 45108
Misses ? 4066
Partials ? 0
Continue to review full report at Codecov.
|
|
@datapythonista, @TomAugspurger mentioned in #20313 this edited docstring in core/generic.py it will be used by both Series.add_suffix and DataFrame.add_suffix to avoid splitting the docstring. |
pandas/core/generic.py
Outdated
| See Also | ||
| -------- | ||
| Series.add_prefix: Prefix labels with string `prefix`. |
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.
As it's for both Series and DataFrame would make sense to have the .add_prefix method of both classes. Or none of them, there is some discussion about whether to have them or not here: #20289 (comment)
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.
Good call. Added in the latest commit to both.
pandas/core/generic.py
Outdated
| See Also | ||
| -------- | ||
| Series.add_prefix: Prefix labels with string `prefix`. |
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.
Good call. Added in the latest commit to both.
|
Thanks again @astrastefania :) |
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 --diffpython doc/make.py --single <your-function-or-method>Please include the output of the validation script below between the "```" ticks:
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.