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: update the pandas.Series.add_suffix docstring #20315

Merged
merged 5 commits into from
Mar 13, 2018

Conversation

astrastefania
Copy link
Contributor

Checklist for the pandas documentation sprint (ignore this if you are doing
an unrelated PR):

  • PR title is "DOC: update the docstring"
  • The validation script passes: scripts/validate_docstrings.py <your-function-or-method>
  • The PEP8 style check passes: git diff upstream/master -u -- "*.py" | flake8 --diff
  • The html version looks good: python doc/make.py --single <your-function-or-method>
  • It has been proofread on language by another sprint participant

Please include the output of the validation script below between the "```" ticks:

################################################################################
##################### Docstring (pandas.Series.add_suffix) #####################
################################################################################

Add a suffix string to panel items names.

Parameters
----------
suffix : str
    The string to add after each item name.

Returns
-------
Series
    Original Series with updated item names.

See Also
--------
pandas.Series.add_prefix: Concatenate prefix string with panel items names.

Examples
--------
>>> s = pd.Series([1,2,3,4])
>>> s
0    1
1    2
2    3
3    4
dtype: int64
>>> s.add_suffix('_item')
0_item    1
1_item    2
2_item    3
3_item    4
dtype: int64

################################################################################
################################## Validation ##################################
################################################################################

Errors found:
	No extended summary found

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.

@datapythonista
Copy link
Member

Same comments as in #20313 :)

@astrastefania
Copy link
Contributor Author

Docstring fixed. :)

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.

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
Copy link

codecov bot commented Mar 13, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@7c5bae3). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #20315   +/-   ##
=========================================
  Coverage          ?   91.73%           
=========================================
  Files             ?      150           
  Lines             ?    49174           
  Branches          ?        0           
=========================================
  Hits              ?    45108           
  Misses            ?     4066           
  Partials          ?        0
Flag Coverage Δ
#multiple 90.11% <ø> (?)
#single 41.86% <ø> (?)
Impacted Files Coverage Δ
pandas/core/generic.py 95.85% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c5bae3...fdba3d4. Read the comment docs.

@astrastefania
Copy link
Contributor Author

@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.

If all agree both #20315 and #20313 should be fine now. 😸


See Also
--------
Series.add_prefix: Prefix labels with string `prefix`.
Copy link
Member

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)

Copy link
Contributor

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.


See Also
--------
Series.add_prefix: Prefix labels with string `prefix`.
Copy link
Contributor

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.

@TomAugspurger TomAugspurger merged commit 281ce99 into pandas-dev:master Mar 13, 2018
@TomAugspurger
Copy link
Contributor

Thanks again @astrastefania :)

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.

None yet

4 participants