diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 76a00071c8adc..b266702f9a6d3 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6597,7 +6597,7 @@ def nlargest(self, n, columns, keep: str = "first") -> DataFrame: - `first` : prioritize the first occurrence(s) - `last` : prioritize the last occurrence(s) - ``all`` : do not drop any duplicates, even it means - selecting more than `n` items. + selecting more than `n` items. Returns ------- diff --git a/pandas/core/series.py b/pandas/core/series.py index 6f48da82169b2..6aefc2c7a5788 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -3692,11 +3692,11 @@ def nlargest(self, n=5, keep="first") -> Series: Series of `n` elements: - ``first`` : return the first `n` occurrences in order - of appearance. + of appearance. - ``last`` : return the last `n` occurrences in reverse - order of appearance. + order of appearance. - ``all`` : keep all occurrences. This can result in a Series of - size larger than `n`. + size larger than `n`. Returns ------- @@ -3790,11 +3790,11 @@ def nsmallest(self, n: int = 5, keep: str = "first") -> Series: Series of `n` elements: - ``first`` : return the first `n` occurrences in order - of appearance. + of appearance. - ``last`` : return the last `n` occurrences in reverse - order of appearance. + order of appearance. - ``all`` : keep all occurrences. This can result in a Series of - size larger than `n`. + size larger than `n`. Returns ------- diff --git a/pandas/core/shared_docs.py b/pandas/core/shared_docs.py index 7d89f2e8b7789..9c9e70789390d 100644 --- a/pandas/core/shared_docs.py +++ b/pandas/core/shared_docs.py @@ -492,7 +492,7 @@ ------ AssertionError * If `regex` is not a ``bool`` and `to_replace` is not - ``None``. + ``None``. TypeError * If `to_replace` is not a scalar, array-like, ``dict``, or ``None``