Skip to content

Commit

Permalink
DOC: Fix #24268 by updating description for keep in Series.nlargest (#…
Browse files Browse the repository at this point in the history
…25358)

* DOC: Fix #24268 by updating description for keep
  • Loading branch information
bharatr21 authored and TomAugspurger committed Mar 5, 2019
1 parent 3bbcacf commit 076b5a8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3098,8 +3098,10 @@ def nlargest(self, n=5, keep='first'):
When there are duplicate values that cannot all fit in a
Series of `n` elements:
- ``first`` : take the first occurrences based on the index order
- ``last`` : take the last occurrences based on the index order
- ``first`` : return the first `n` occurrences in order
of appearance.
- ``last`` : return the last `n` occurrences in reverse
order of appearance.
- ``all`` : keep all occurrences. This can result in a Series of
size larger than `n`.
Expand Down Expand Up @@ -3194,8 +3196,10 @@ def nsmallest(self, n=5, keep='first'):
When there are duplicate values that cannot all fit in a
Series of `n` elements:
- ``first`` : take the first occurrences based on the index order
- ``last`` : take the last occurrences based on the index order
- ``first`` : return the first `n` occurrences in order
of appearance.
- ``last`` : return the last `n` occurrences in reverse
order of appearance.
- ``all`` : keep all occurrences. This can result in a Series of
size larger than `n`.
Expand Down Expand Up @@ -3236,7 +3240,7 @@ def nsmallest(self, n=5, keep='first'):
Monserat 5200
dtype: int64
The `n` largest elements where ``n=5`` by default.
The `n` smallest elements where ``n=5`` by default.
>>> s.nsmallest()
Monserat 5200
Expand Down

0 comments on commit 076b5a8

Please sign in to comment.