@@ -855,30 +855,6 @@ def factorize_(
855
855
) -> tuple [np .ndarray , tuple [np .ndarray , ...], tuple [int , ...], int , int , None ]: ...
856
856
857
857
858
- @overload
859
- def factorize_ (
860
- by : T_Bys ,
861
- axes : T_Axes ,
862
- * ,
863
- expected_groups : T_ExpectIndexOptTuple | None = None ,
864
- reindex : bool = False ,
865
- sort : bool = True ,
866
- fastpath : Literal [False ] = False ,
867
- ) -> tuple [np .ndarray , tuple [np .ndarray , ...], tuple [int , ...], int , int , FactorProps ]: ...
868
-
869
-
870
- @overload
871
- def factorize_ (
872
- by : T_Bys ,
873
- axes : T_Axes ,
874
- * ,
875
- expected_groups : T_ExpectIndexOptTuple | None = None ,
876
- reindex : bool = False ,
877
- sort : bool = True ,
878
- fastpath : bool = False ,
879
- ) -> tuple [np .ndarray , tuple [np .ndarray , ...], tuple [int , ...], int , int , FactorProps | None ]: ...
880
-
881
-
882
858
def _factorize_single (by , expect , * , sort : bool , reindex : bool ):
883
859
flat = by .reshape (- 1 )
884
860
if isinstance (expect , pd .RangeIndex ):
@@ -940,6 +916,30 @@ def _ravel_factorized(*factorized: np.ndarray, grp_shape: tuple[int, ...]) -> np
940
916
return group_idx
941
917
942
918
919
+ @overload
920
+ def factorize_ (
921
+ by : T_Bys ,
922
+ axes : T_Axes ,
923
+ * ,
924
+ expected_groups : T_ExpectIndexOptTuple | None = None ,
925
+ reindex : bool = False ,
926
+ sort : bool = True ,
927
+ fastpath : Literal [False ] = False ,
928
+ ) -> tuple [np .ndarray , tuple [np .ndarray , ...], tuple [int , ...], int , int , FactorProps ]: ...
929
+
930
+
931
+ @overload
932
+ def factorize_ (
933
+ by : T_Bys ,
934
+ axes : T_Axes ,
935
+ * ,
936
+ expected_groups : T_ExpectIndexOptTuple | None = None ,
937
+ reindex : bool = False ,
938
+ sort : bool = True ,
939
+ fastpath : bool = False ,
940
+ ) -> tuple [np .ndarray , tuple [np .ndarray , ...], tuple [int , ...], int , int , FactorProps | None ]: ...
941
+
942
+
943
943
def factorize_ (
944
944
by : T_Bys ,
945
945
axes : T_Axes ,
@@ -967,10 +967,10 @@ def factorize_(
967
967
]
968
968
results = tuple (f .result () for f in futures )
969
969
else :
970
- results = [
970
+ results = tuple (
971
971
_factorize_single (groupvar , expect , sort = sort , reindex = reindex )
972
972
for groupvar , expect in zip (by , expected_groups )
973
- ]
973
+ )
974
974
found_groups = [r [0 ] for r in results ]
975
975
factorized = [r [1 ] for r in results ]
976
976
0 commit comments