@@ -2,11 +2,7 @@ from collections.abc import (
22 Callable ,
33 Sequence ,
44)
5- from typing import (
6- Any ,
7- Literal ,
8- overload ,
9- )
5+ from typing import Any
106
117import numpy as np
128from pandas import Series
@@ -48,7 +44,6 @@ class Categorical(ExtensionArray):
4844 def dtype (self ) -> CategoricalDtype : ...
4945 def astype (self , dtype : Dtype , copy : bool = ...) -> ArrayLike : ...
5046 def size (self ) -> int : ...
51- def itemsize (self ) -> int : ...
5247 def tolist (self ) -> list [Scalar ]: ...
5348 to_list = ...
5449 @classmethod
@@ -65,72 +60,16 @@ class Categorical(ExtensionArray):
6560 def set_ordered (self , value ) -> Categorical : ...
6661 def as_ordered (self ) -> Categorical : ...
6762 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
8163 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 = ...
8965 ) -> 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 : ...
9967 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 = ...
13169 ) -> 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 : ...
13473 def map (self , mapper ): ...
13574 def __eq__ (self , other ) -> bool : ...
13675 def __ne__ (self , other ) -> bool : ...
@@ -161,23 +100,19 @@ class Categorical(ExtensionArray):
161100 self , * , inplace : bool = ..., ascending : bool = ..., na_position : str = ...
162101 ): ...
163102 def view (self , dtype = ...): ...
164- def to_dense (self ): ...
165103 def fillna (self , value = ..., method = ..., limit = ...): ...
166104 def take (
167105 self , indexer : TakeIndexer , * , allow_fill : bool = ..., fill_value = ...
168106 ) -> Categorical : ...
169- def take_nd (self , indexer , allow_fill : bool = ..., fill_value = ...): ...
170107 def __len__ (self ) -> int : ...
171108 def __iter__ (self ): ...
172109 def __contains__ (self , key ) -> bool : ...
173110 def __getitem__ (self , key ): ...
174111 def __setitem__ (self , key , value ) -> None : ...
175112 def min (self , * , skipna : bool = ...): ...
176113 def max (self , * , skipna : bool = ...): ...
177- def mode (self , dropna : bool = ...): ...
178114 def unique (self ): ...
179115 def equals (self , other ): ...
180- def is_dtype_equal (self , other ): ...
181116 def describe (self ): ...
182117 def repeat (self , repeats , axis = ...): ...
183118 def isin (self , values ): ...
0 commit comments