3333 TYPE_CHECKING_INVALID_USAGE ,
3434 check ,
3535 np_1darray ,
36+ np_1darray_float ,
3637 np_2darray ,
3738 np_ndarray_bool ,
3839 pytest_warns_bounded ,
@@ -1030,14 +1031,14 @@ def test_cut() -> None:
10301031 [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ], 4 , labels = ["1" , "2" , "3" , "4" ], retbins = True
10311032 )
10321033 check (assert_type (d0 , pd .Categorical ), pd .Categorical )
1033- check (assert_type (d1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1034+ check (assert_type (d1 , np_1darray_float ), np_1darray [Any ], np .floating )
10341035 check (
10351036 assert_type (e0 , np_1darray [np .intp ]),
10361037 np_1darray [np .intp ],
10371038 )
1038- check (assert_type (e1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1039+ check (assert_type (e1 , np_1darray_float ), np_1darray [Any ], np .floating )
10391040 check (assert_type (f0 , pd .Categorical ), pd .Categorical )
1040- check (assert_type (f1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1041+ check (assert_type (f1 , np_1darray_float ), np_1darray [Any ], np .floating )
10411042
10421043 g = pd .cut (pd .Series ([1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ]), 4 , precision = 1 , duplicates = "drop" )
10431044 h = pd .cut (pd .Series ([1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ]), 4 , labels = False , duplicates = "raise" )
@@ -1072,11 +1073,11 @@ def test_cut() -> None:
10721073 retbins = True ,
10731074 )
10741075 check (assert_type (j0 , pd .Series ), pd .Series )
1075- check (assert_type (j1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1076+ check (assert_type (j1 , np_1darray_float ), np_1darray [Any ], np .floating )
10761077 check (assert_type (k0 , pd .Series ), pd .Series )
1077- check (assert_type (k1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1078+ check (assert_type (k1 , np_1darray_float ), np_1darray [Any ], np .floating )
10781079 check (assert_type (l0 , pd .Series ), pd .Series )
1079- check (assert_type (l1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1080+ check (assert_type (l1 , np_1darray_float ), np_1darray [Any ], np .floating )
10801081 check (assert_type (m0 , pd .Series ), pd .Series )
10811082 check (assert_type (m1 , pd .IntervalIndex ), pd .IntervalIndex )
10821083
@@ -1149,10 +1150,10 @@ def test_qcut() -> None:
11491150 check (assert_type (c0 , pd .Categorical ), pd .Categorical )
11501151 check (assert_type (d0 , pd .Series ), pd .Series )
11511152
1152- check (assert_type (a1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1153- check (assert_type (b1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1154- check (assert_type (c1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1155- check (assert_type (d1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1153+ check (assert_type (a1 , np_1darray_float ), np_1darray [Any ], np .floating )
1154+ check (assert_type (b1 , np_1darray_float ), np_1darray [Any ], np .floating )
1155+ check (assert_type (c1 , np_1darray_float ), np_1darray [Any ], np .floating )
1156+ check (assert_type (d1 , np_1darray_float ), np_1darray [Any ], np .floating )
11561157
11571158 e0 , e1 = pd .qcut (val_list , [0.25 , 0.5 , 0.75 ], retbins = True )
11581159 f0 , f1 = pd .qcut (val_arr , np .array ([0.25 , 0.5 , 0.75 ]), retbins = True )
@@ -1170,16 +1171,19 @@ def test_qcut() -> None:
11701171 check (assert_type (h0 , pd .Series ), pd .Series )
11711172 check (
11721173 assert_type (i0 , np_1darray [np .intp | np .double ]),
1173- np_1darray [np .double ], # because of nans
1174+ np_1darray [Any ], # because of nans
1175+ np .floating ,
1176+ )
1177+ check (
1178+ assert_type (j0 , np_1darray [np .intp | np .double ]), np_1darray [Any ], np .floating
11741179 )
1175- check (assert_type (j0 , np_1darray [np .intp | np .double ]), np_1darray [np .double ])
11761180
1177- check (assert_type (e1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1178- check (assert_type (f1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1179- check (assert_type (g1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1180- check (assert_type (h1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1181- check (assert_type (i1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1182- check (assert_type (j1 , np_1darray [ np . double ] ), np_1darray [np .double ] )
1181+ check (assert_type (e1 , np_1darray_float ), np_1darray [Any ], np .floating )
1182+ check (assert_type (f1 , np_1darray_float ), np_1darray [Any ], np .floating )
1183+ check (assert_type (g1 , np_1darray_float ), np_1darray [Any ], np .floating )
1184+ check (assert_type (h1 , np_1darray_float ), np_1darray [Any ], np .floating )
1185+ check (assert_type (i1 , np_1darray_float ), np_1darray [Any ], np .floating )
1186+ check (assert_type (j1 , np_1darray_float ), np_1darray [Any ], np .floating )
11831187
11841188
11851189@pytest .mark .xfail (
0 commit comments