Skip to content

Commit 72f7f13

Browse files
committed
Fix index compute type
1 parent 89a656c commit 72f7f13

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/core/methods/selectn.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,12 @@ class SelectNSeries(SelectN[Series]):
105105
nordered : Series
106106
"""
107107

108-
def compute(self, ascending: bool) -> Series:
108+
def compute(self, ascending: bool | Sequence[bool]) -> Series:
109109
from pandas.core.reshape.concat import concat
110110

111-
assert isinstance(ascending, bool)
111+
if isinstance(ascending, Sequence):
112+
assert len(ascending) == 1
113+
ascending = ascending[0]
112114

113115
n = self.n
114116
dtype = self.obj.dtype

0 commit comments

Comments
 (0)