Skip to content

Commit c9e5a3e

Browse files
Fix issues
1 parent 51d4e03 commit c9e5a3e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pandas-stubs/core/arrays/categorical.pyi

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ from collections.abc import (
44
Hashable,
55
Sequence,
66
)
7+
import sys
78
from typing import (
89
Any,
910
overload,
@@ -98,9 +99,15 @@ class Categorical(ExtensionArray):
9899
def notnull(self) -> np_1darray_bool: ...
99100
def value_counts(self, dropna: bool = True) -> Series: ...
100101
def check_for_ordered(self, op: Any) -> None: ...
101-
def argsort(
102-
self, *, ascending: bool = ..., kind: str = ..., **kwargs: Any
103-
) -> npt.NDArray[np.intp]: ...
102+
if sys.version_info >= (3, 11):
103+
def argsort(
104+
self, *, ascending: bool = ..., kind: str = ..., **kwargs: Any
105+
) -> npt.NDArray[np.intp]: ...
106+
else:
107+
def argsort(
108+
self, *, ascending: bool = ..., kind: str = ..., **kwargs: Any
109+
) -> np.ndarray[tuple[int], dtype[Any]]: ...
110+
104111
def sort_values(
105112
self, *, inplace: bool = ..., ascending: bool = ..., na_position: str = ...
106113
) -> Self: ...

0 commit comments

Comments
 (0)