@@ -22,6 +22,7 @@ from pandas._typing import (
2222 IntervalT ,
2323 TakeIndexer ,
2424 np_1darray ,
25+ np_1darray_int64 ,
2526 np_ndarray ,
2627)
2728
@@ -36,19 +37,19 @@ def unique(values: PeriodIndex) -> PeriodIndex: ...
3637@overload
3738def unique (values : DatetimeIndex ) -> np_1darray [np .datetime64 ] | DatetimeIndex : ...
3839@overload
39- def unique (values : Index ) -> np_1darray [ Any ] | Index : ...
40+ def unique (values : Index ) -> np_1darray | Index : ...
4041@overload
4142def unique (values : Categorical ) -> Categorical : ...
4243
4344# @overload
44- # def unique(values: Series[Never]) -> np_1darray[Any] | ExtensionArray: ...
45+ # def unique(values: Series[Never]) -> np_1darray | ExtensionArray: ...
4546# TODO: DatetimeArray python/mypy#19952
4647# @overload
4748# def unique(values: Series[Timestamp]) -> np_1darray[np.datetime64] | ExtensionArray: ...
4849# @overload
4950# def unique(values: Series[int]) -> np_1darray[np.integer] | ExtensionArray: ...
5051@overload
51- def unique (values : Series ) -> np_1darray [ Any ] | ExtensionArray : ...
52+ def unique (values : Series ) -> np_1darray | ExtensionArray : ...
5253@overload
5354def unique (values : npt .NDArray [GenericT ]) -> np_1darray [GenericT ]: ...
5455@overload
@@ -59,21 +60,21 @@ def factorize(
5960 sort : bool = ...,
6061 use_na_sentinel : bool = ...,
6162 size_hint : int | None = ...,
62- ) -> tuple [np_1darray [ np . int64 ] , np_1darray [GenericT ]]: ...
63+ ) -> tuple [np_1darray_int64 , np_1darray [GenericT ]]: ...
6364@overload
6465def factorize (
6566 values : Index | Series ,
6667 sort : bool = ...,
6768 use_na_sentinel : bool = ...,
6869 size_hint : int | None = ...,
69- ) -> tuple [np_1darray [ np . int64 ] , Index ]: ...
70+ ) -> tuple [np_1darray_int64 , Index ]: ...
7071@overload
7172def factorize (
7273 values : Categorical ,
7374 sort : bool = ...,
7475 use_na_sentinel : bool = ...,
7576 size_hint : int | None = ...,
76- ) -> tuple [np_1darray [ np . int64 ] , Categorical ]: ...
77+ ) -> tuple [np_1darray_int64 , Categorical ]: ...
7778def value_counts (
7879 values : AnyArrayLike | list | tuple ,
7980 sort : bool = True ,
@@ -88,4 +89,4 @@ def take(
8889 axis : Literal [0 , 1 ] = 0 ,
8990 allow_fill : bool = False ,
9091 fill_value : Any = None ,
91- ) -> np_1darray [ Any ] | ExtensionArray : ...
92+ ) -> np_1darray | ExtensionArray : ...
0 commit comments