@@ -2,11 +2,7 @@ from collections.abc import (
2
2
Callable ,
3
3
Sequence ,
4
4
)
5
- from typing import (
6
- Any ,
7
- Literal ,
8
- overload ,
9
- )
5
+ from typing import Any
10
6
11
7
import numpy as np
12
8
from pandas import Series
@@ -48,7 +44,6 @@ class Categorical(ExtensionArray):
48
44
def dtype (self ) -> CategoricalDtype : ...
49
45
def astype (self , dtype : Dtype , copy : bool = ...) -> ArrayLike : ...
50
46
def size (self ) -> int : ...
51
- def itemsize (self ) -> int : ...
52
47
def tolist (self ) -> list [Scalar ]: ...
53
48
to_list = ...
54
49
@classmethod
@@ -65,72 +60,16 @@ class Categorical(ExtensionArray):
65
60
def set_ordered (self , value ) -> Categorical : ...
66
61
def as_ordered (self ) -> Categorical : ...
67
62
def as_unordered (self ) -> Categorical : ...
68
- @overload
69
- def set_categories (
70
- self , new_categories , ordered = ..., rename : bool = ..., * , inplace : Literal [True ]
71
- ) -> None : ...
72
- @overload
73
- def set_categories (
74
- self ,
75
- new_categories ,
76
- ordered = ...,
77
- rename : bool = ...,
78
- inplace : Literal [False ] = ...,
79
- ) -> Categorical : ...
80
- @overload
81
63
def set_categories (
82
- self , new_categories , ordered = ..., rename : bool = ..., inplace : bool = ...
83
- ) -> Categorical | None : ...
84
- @overload
85
- def rename_categories (self , new_categories , inplace : Literal [True ]) -> None : ...
86
- @overload
87
- def rename_categories (
88
- self , new_categories , inplace : Literal [False ] = ...
64
+ self , new_categories , ordered : bool | None = ..., rename : bool = ...
89
65
) -> Categorical : ...
90
- @overload
91
- def rename_categories (
92
- self , new_categories , inplace : bool = ...
93
- ) -> Categorical | None : ...
94
- @overload
95
- def reorder_categories (
96
- self , new_categories , ordered = ..., * , inplace : Literal [True ]
97
- ) -> None : ...
98
- @overload
66
+ def rename_categories (self , new_categories ) -> Categorical : ...
99
67
def reorder_categories (
100
- self , new_categories , ordered = ..., inplace : Literal [False ] = ...
101
- ) -> Categorical : ...
102
- @overload
103
- def reorder_categories (
104
- self , new_categories , ordered = ..., inplace : bool = ...
105
- ) -> Categorical | None : ...
106
- @overload
107
- def add_categories (self , new_categories , inplace : Literal [True ]) -> None : ...
108
- @overload
109
- def add_categories (
110
- self , new_categories , inplace : Literal [False ] = ...
111
- ) -> Categorical : ...
112
- @overload
113
- def add_categories (
114
- self , new_categories , inplace : bool = ...
115
- ) -> Categorical | None : ...
116
- @overload
117
- def remove_categories (self , removals , inplace : Literal [True ]) -> None : ...
118
- @overload
119
- def remove_categories (
120
- self , removals , inplace : Literal [False ] = ...
121
- ) -> Categorical : ...
122
- @overload
123
- def remove_categories (
124
- self , removals , inplace : bool = ...
125
- ) -> Categorical | None : ...
126
- @overload
127
- def remove_unused_categories (self , inplace : Literal [True ]) -> None : ...
128
- @overload
129
- def remove_unused_categories (
130
- self , inplace : Literal [False ] = ...
68
+ self , new_categories , ordered : bool | None = ...
131
69
) -> Categorical : ...
132
- @overload
133
- def remove_unused_categories (self , inplace : bool = ...) -> Categorical | None : ...
70
+ def add_categories (self , new_categories ) -> Categorical : ...
71
+ def remove_categories (self , removals ) -> Categorical : ...
72
+ def remove_unused_categories (self ) -> Categorical : ...
134
73
def map (self , mapper ): ...
135
74
def __eq__ (self , other ) -> bool : ...
136
75
def __ne__ (self , other ) -> bool : ...
@@ -161,23 +100,19 @@ class Categorical(ExtensionArray):
161
100
self , * , inplace : bool = ..., ascending : bool = ..., na_position : str = ...
162
101
): ...
163
102
def view (self , dtype = ...): ...
164
- def to_dense (self ): ...
165
103
def fillna (self , value = ..., method = ..., limit = ...): ...
166
104
def take (
167
105
self , indexer : TakeIndexer , * , allow_fill : bool = ..., fill_value = ...
168
106
) -> Categorical : ...
169
- def take_nd (self , indexer , allow_fill : bool = ..., fill_value = ...): ...
170
107
def __len__ (self ) -> int : ...
171
108
def __iter__ (self ): ...
172
109
def __contains__ (self , key ) -> bool : ...
173
110
def __getitem__ (self , key ): ...
174
111
def __setitem__ (self , key , value ) -> None : ...
175
112
def min (self , * , skipna : bool = ...): ...
176
113
def max (self , * , skipna : bool = ...): ...
177
- def mode (self , dropna : bool = ...): ...
178
114
def unique (self ): ...
179
115
def equals (self , other ): ...
180
- def is_dtype_equal (self , other ): ...
181
116
def describe (self ): ...
182
117
def repeat (self , repeats , axis = ...): ...
183
118
def isin (self , values ): ...
0 commit comments