diff --git a/pandas/core/series.py b/pandas/core/series.py index cada6663ce651..f6598ed1ee614 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -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`. @@ -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`. @@ -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