-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
DOC: Add examples to Series.str.slice() with negative arguments GH27802 #27834
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
Hello @phillipwalters! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-08-09 04:50:22 UTC |
$ python scripts/validate_docstrings.py pandas.Series.str.slice ################################################################################ Slice substrings from each element in the Series or Index. Parametersstart : int, optional ReturnsSeries or Index of object See AlsoSeries.str.slice_replace : Replace a slice with a string. Examples
Negative values can be used for any of the three parameters. For start or stop, a value of -1 will be the last
A negative value for step will simply step in the other direction.
Equivalent behaviour to:
################################################################################ 1 Warnings found: |
1fcf5b0
to
225e9d6
Compare
225e9d6
to
c1481af
Compare
This is a bit too much, and a single example with negative indexes is enough. If you wantvto to rebase and add the text snippet, that would be nice. |
Seems like https://github.com/pandas-dev/pandas/pull/27832/files also worked on this. @phillipwalters perhaps just add one more example showing a negative slice to reverse the string? |
@phillipwalters Maybe add an example that uses the shorthand notation, e.g.:
|
I saw his PR shortly after I submitted this one, and it looks like you guys went with that one. Sounds like the right choice to me. Thanks for your guys' suggestions, though! |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff