Skip to content
Prev Previous commit
Next Next commit
Fix PEP8 issues and a typo
Fix PEP8 issues in Series.nlargest and a typo in Series.nsmallest
  • Loading branch information
bharatr21 authored Feb 18, 2019
commit ab33dc103d988e7a419b9cff697d5f6e21f7c807
14 changes: 9 additions & 5 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3100,8 +3100,10 @@ def nlargest(self, n=5, keep='first'):
When there are duplicate values that cannot all fit in a
Series of `n` elements:

- ``first`` : return the first n occurrences in the given index order
- ``last`` : return the last n occurrences in the reverse of the given index order
- ``first`` : return the first `n` occurrences in the
given index order.
- ``last`` : return the last `n` occurrences in the
reverse of the given index order.
- ``all`` : keep all occurrences. This can result in a Series of
size larger than `n`.

Expand Down Expand Up @@ -3196,8 +3198,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 the
given index order.
- ``last`` : return the last `n` occurrences in the
reverse of the given index order.
- ``all`` : keep all occurrences. This can result in a Series of
size larger than `n`.

Expand Down Expand Up @@ -3238,7 +3242,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