Skip to content

DOC: update the pandas.Series.str.endswith docstring #20491

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

Merged
merged 1 commit into from
Mar 28, 2018

Conversation

dcreekp
Copy link
Contributor

@dcreekp dcreekp commented Mar 26, 2018

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

  • [ X] PR title is "DOC: update the docstring"
  • [X ] The validation script passes: scripts/validate_docstrings.py <your-function-or-method>
  • [ X] The PEP8 style check passes: git diff upstream/master -u -- "*.py" | flake8 --diff
  • [X ] The html version looks good: python doc/make.py --single <your-function-or-method>
  • [ X ] 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.str.endswith) ####################
################################################################################

Test if the end of each string element matches a pattern.

Equivalent to :meth:`str.endswith`.

Parameters
----------
pat : str
    Character sequence. Regular expressions are not accepted.
na : object, default NaN
    Object shown if element tested is not a string.

Returns
-------
Series or Index of bool
    A Series of booleans indicating whether the given pattern matches
    the end of each string element.

See Also
--------
str.endswith : Python standard library string method.
Series.str.startswith : Same as endswith, but tests the start of string.
Series.str.contains : Tests if string element contains a pattern.

Examples
--------
>>> s = pd.Series(['bat', 'bear', 'caT', np.nan])
>>> s
0     bat
1    bear
2     caT
3     NaN
dtype: object

>>> s.str.endswith('t')
0     True
1    False
2    False
3      NaN
dtype: object

Specifying `na` to be `False` instead of `NaN`.

>>> s.str.endswith('t', na=False)
0     True
1    False
2    False
3    False
dtype: bool

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

Docstring for "pandas.Series.str.endswith" correct. :)

@codecov
Copy link

codecov bot commented Mar 26, 2018

Codecov Report

Merging #20491 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #20491      +/-   ##
==========================================
- Coverage   91.85%   91.82%   -0.03%     
==========================================
  Files         152      152              
  Lines       49235    49235              
==========================================
- Hits        45224    45212      -12     
- Misses       4011     4023      +12
Flag Coverage Δ
#multiple 90.21% <100%> (-0.03%) ⬇️
#single 41.88% <33.33%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/strings.py 98.32% <100%> (ø) ⬆️
pandas/plotting/_converter.py 65.07% <0%> (-1.74%) ⬇️

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 402ad45...6a5ff51. Read the comment docs.

@TomAugspurger TomAugspurger added this to the 0.23.0 milestone Mar 28, 2018
@TomAugspurger
Copy link
Contributor

Thanks @dcreekp

@TomAugspurger TomAugspurger merged commit b1c54f4 into pandas-dev:master Mar 28, 2018
javadnoorb pushed a commit to javadnoorb/pandas that referenced this pull request Mar 29, 2018
dworvos pushed a commit to dworvos/pandas that referenced this pull request Apr 2, 2018
kornilova203 pushed a commit to kornilova203/pandas that referenced this pull request Apr 23, 2018
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.

2 participants