@@ -22,11 +22,13 @@ from typing_extensions import Self
22
22
23
23
from pandas ._typing import (
24
24
S1 ,
25
+ AnyArrayLike ,
25
26
AxisIndex ,
26
27
DropKeep ,
27
28
DTypeLike ,
28
29
GenericT ,
29
30
GenericT_co ,
31
+ ListLike ,
30
32
NDFrameT ,
31
33
Scalar ,
32
34
SupportsDType ,
@@ -51,7 +53,7 @@ class IndexOpsMixin(OpsMixin, Generic[S1, GenericT_co]):
51
53
@property
52
54
def T (self ) -> Self : ...
53
55
@property
54
- def shape (self ) -> tuple : ...
56
+ def shape (self ) -> tuple [ int , ...] : ...
55
57
@property
56
58
def ndim (self ) -> int : ...
57
59
def item (self ) -> S1 : ...
@@ -67,41 +69,45 @@ class IndexOpsMixin(OpsMixin, Generic[S1, GenericT_co]):
67
69
dtype : None = None ,
68
70
copy : bool = False ,
69
71
na_value : Scalar = ...,
70
- ** kwargs ,
72
+ ** kwargs : Any ,
71
73
) -> np_1darray [GenericT_co ]: ...
72
74
@overload
73
75
def to_numpy (
74
76
self ,
75
77
dtype : np .dtype [GenericT ] | SupportsDType [GenericT ] | type [GenericT ],
76
78
copy : bool = False ,
77
79
na_value : Scalar = ...,
78
- ** kwargs ,
80
+ ** kwargs : Any ,
79
81
) -> np_1darray [GenericT ]: ...
80
82
@overload
81
83
def to_numpy (
82
84
self ,
83
85
dtype : DTypeLike ,
84
86
copy : bool = False ,
85
87
na_value : Scalar = ...,
86
- ** kwargs ,
88
+ ** kwargs : Any ,
87
89
) -> np_1darray : ...
88
90
@property
89
91
def empty (self ) -> bool : ...
90
- def max (self , axis = ..., skipna : bool = ..., ** kwargs ): ...
91
- def min (self , axis = ..., skipna : bool = ..., ** kwargs ): ...
92
+ def max (
93
+ self , axis : AxisIndex | None = ..., skipna : bool = ..., ** kwargs : Any
94
+ ) -> S1 : ...
95
+ def min (
96
+ self , axis : AxisIndex | None = ..., skipna : bool = ..., ** kwargs : Any
97
+ ) -> S1 : ...
92
98
def argmax (
93
99
self ,
94
100
axis : AxisIndex | None = ...,
95
101
skipna : bool = True ,
96
- * args ,
97
- ** kwargs ,
102
+ * args : Any ,
103
+ ** kwargs : Any ,
98
104
) -> np .int64 : ...
99
105
def argmin (
100
106
self ,
101
107
axis : AxisIndex | None = ...,
102
108
skipna : bool = True ,
103
- * args ,
104
- ** kwargs ,
109
+ * args : Any ,
110
+ ** kwargs : Any ,
105
111
) -> np .int64 : ...
106
112
def tolist (self ) -> list [S1 ]: ...
107
113
def to_list (self ) -> list [S1 ]: ...
@@ -114,7 +120,7 @@ class IndexOpsMixin(OpsMixin, Generic[S1, GenericT_co]):
114
120
normalize : Literal [False ] = ...,
115
121
sort : bool = ...,
116
122
ascending : bool = ...,
117
- bins = ...,
123
+ bins : int | None = ...,
118
124
dropna : bool = ...,
119
125
) -> Series [int ]: ...
120
126
@overload
@@ -123,7 +129,7 @@ class IndexOpsMixin(OpsMixin, Generic[S1, GenericT_co]):
123
129
normalize : Literal [True ],
124
130
sort : bool = ...,
125
131
ascending : bool = ...,
126
- bins = ...,
132
+ bins : int | None = ...,
127
133
dropna : bool = ...,
128
134
) -> Series [float ]: ...
129
135
def nunique (self , dropna : bool = True ) -> int : ...
@@ -136,7 +142,18 @@ class IndexOpsMixin(OpsMixin, Generic[S1, GenericT_co]):
136
142
def factorize (
137
143
self , sort : bool = False , use_na_sentinel : bool = True
138
144
) -> tuple [np_1darray , np_1darray | Index | Categorical ]: ...
145
+ @overload
139
146
def searchsorted (
140
- self , value , side : Literal ["left" , "right" ] = ..., sorter = ...
141
- ) -> int | list [int ]: ...
147
+ self ,
148
+ value : Scalar ,
149
+ side : Literal ["left" , "right" ] = ...,
150
+ sorter : AnyArrayLike = ...,
151
+ ) -> np .intp : ...
152
+ @overload
153
+ def searchsorted (
154
+ self ,
155
+ value : ListLike ,
156
+ side : Literal ["left" , "right" ] = ...,
157
+ sorter : AnyArrayLike = ...,
158
+ ) -> np_1darray [np .intp ]: ...
142
159
def drop_duplicates (self , * , keep : DropKeep = ...) -> Self : ...
0 commit comments