@@ -1234,14 +1234,25 @@ def test_get_indexer_strings_raises(self):
1234
1234
["a" , "b" , "c" , "d" ], method = "pad" , tolerance = [2 , 2 , 2 , 2 ]
1235
1235
)
1236
1236
1237
- @pytest .mark .parametrize ("idx_class" , [Int64Index , RangeIndex , Float64Index ])
1238
- def test_get_indexer_numeric_index_boolean_target (self , idx_class ):
1237
+ @pytest .mark .parametrize (
1238
+ "idx_class" , [Int64Index , RangeIndex , Float64Index , UInt64Index ]
1239
+ )
1240
+ @pytest .mark .parametrize ("method" , ["get_indexer" , "get_indexer_non_unique" ])
1241
+ def test_get_indexer_numeric_index_boolean_target (self , method , idx_class ):
1239
1242
# GH 16877
1240
1243
1241
1244
numeric_index = idx_class (RangeIndex (4 ))
1242
- result = numeric_index .get_indexer ([True , False , True ])
1245
+ other = Index ([True , False , True ])
1246
+
1247
+ result = getattr (numeric_index , method )(other )
1243
1248
expected = np .array ([- 1 , - 1 , - 1 ], dtype = np .intp )
1244
- tm .assert_numpy_array_equal (result , expected )
1249
+ if method == "get_indexer" :
1250
+ tm .assert_numpy_array_equal (result , expected )
1251
+ else :
1252
+ expected = np .array ([- 1 , - 1 , - 1 , - 1 ], dtype = np .intp )
1253
+
1254
+ tm .assert_numpy_array_equal (result [0 ], expected )
1255
+ tm .assert_numpy_array_equal (result [1 ], expected )
1245
1256
1246
1257
def test_get_indexer_with_NA_values (
1247
1258
self , unique_nulls_fixture , unique_nulls_fixture2
0 commit comments