Skip to content

DOC: Fix Series nlargest and nsmallest doc strings (#43964) #43964

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 5 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------
Expand Down
12 changes: 6 additions & 6 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
-------
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/shared_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down