Skip to content

Commit dc368b7

Browse files
committed
Fixes
1 parent 541d5f2 commit dc368b7

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

pandas/_typing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,8 @@ def closed(self) -> bool:
416416
SortKind: TypeAlias = Literal["quicksort", "mergesort", "heapsort", "stable"]
417417
NaPosition: TypeAlias = Literal["first", "last"]
418418

419-
# Arguments for nsorted, nsmallest and nlargest.
420-
NsmallestNlargestKeep = Literal["first", "last", "all"]
419+
# Arguments for nsorted, nsmallest and nlargest
420+
NsmallestNlargestKeep: TypeAlias = Literal["first", "last", "all"]
421421

422422
# quantile interpolation
423423
QuantileInterpolation: TypeAlias = Literal[

pandas/core/frame.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7747,9 +7747,6 @@ def nlargest(
77477747
descending order. The columns that are not specified are returned as
77487748
well, but not used for ordering.
77497749
7750-
This method is equivalent to
7751-
``df.nsorted(n, columns, ascending=False)``.
7752-
77537750
This method is equivalent to
77547751
``df.sort_values(columns, ascending=False).head(n)``, but more
77557752
performant.
@@ -7891,9 +7888,6 @@ def nsmallest(
78917888
ascending order. The columns that are not specified are returned as
78927889
well, but not used for ordering.
78937890
7894-
This method is equivalent to
7895-
``df.nsorted(n, columns, ascending=True)``.
7896-
78977891
This method is equivalent to
78987892
``df.sort_values(columns, ascending=True).head(n)``, but more
78997893
performant.

pandas/core/methods/selectn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def compute(self, ascending: bool | Sequence[bool]) -> Series:
115115
n = self.n
116116
dtype = self.obj.dtype
117117
if not self.is_valid_dtype_n_method(dtype):
118-
raise TypeError(f"Cannot use n-sorting with dtype {dtype}")
118+
raise TypeError(f"Cannot sort with dtype {dtype}")
119119

120120
if n <= 0:
121121
return self.obj[[]]

0 commit comments

Comments
 (0)