-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Fix #24268 by updating description for keep in Series.nlargest #25358
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
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
2ebe8ae
DOC: Fix #24268 by updating description for keep
bharatr21 ab33dc1
Fix PEP8 issues and a typo
bharatr21 794f370
Fix PEP8 issues
bharatr21 28aa45b
Update the description of keep
bharatr21 c9de2f6
Fix PEP8 issues again
bharatr21 62ccfed
Fix trailing whitespaces
bharatr21 8506a6e
Fix some docstring issues (as produced by tests)
bharatr21 fdb6ba7
Take suggestions from @TomAugspurger and @WillAyd to improve readability
310682a
Rewording docs according to @WillAyd 's suggestion
bharatr21 5c56fad
Merge remote-tracking branch 'upstream/master'
bharatr21 9a8367d
Removed the confusing lines as suggested by @jreback
bharatr21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is "given index order" the correct description? I interpreted
#24268 (comment) as a modification on the result. So below the descriptions of first / last / all, I would note something like
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.
I will include this, but when keep="last", the row labels are sorted in reverse order even in the examples in #24268
And I feel "given index order" is correct because it is "given" by the user as input, if it is not an implicit RangeIndex
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.
I understand what you are writing here but I find the readability rather difficult. Any reason we don't use the same terminology in the
unique
docstring?Uniques are returned in order of appearance
^ obviously accounting for reversal with the
last
argumentThere 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.
@WillAyd What do you suggest me to do? If it's changing the
unique
docstring, I want to leave this as-is, because I still want to somehow emphasize the fact that index order is reversed whenkeep="last"
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.
My suggested wording is
Return the first n occurrences in order of appearance
for first and thenReturn the last n occurrences in reverse order of appearance