@@ -110,16 +110,16 @@ def test_get_indexer(self):
110
110
@pytest .mark .parametrize (
111
111
"expected,method" ,
112
112
[
113
- (np . array ( [- 1 , 0 , 0 , 1 , 1 ], dtype = np . intp ) , "pad" ),
114
- (np . array ( [- 1 , 0 , 0 , 1 , 1 ], dtype = np . intp ) , "ffill" ),
115
- (np . array ( [0 , 0 , 1 , 1 , 2 ], dtype = np . intp ) , "backfill" ),
116
- (np . array ( [0 , 0 , 1 , 1 , 2 ], dtype = np . intp ) , "bfill" ),
113
+ ([- 1 , 0 , 0 , 1 , 1 ], "pad" ),
114
+ ([- 1 , 0 , 0 , 1 , 1 ], "ffill" ),
115
+ ([0 , 0 , 1 , 1 , 2 ], "backfill" ),
116
+ ([0 , 0 , 1 , 1 , 2 ], "bfill" ),
117
117
],
118
118
)
119
119
def test_get_indexer_methods (self , reverse , expected , method ):
120
120
index1 = Index ([1 , 2 , 3 , 4 , 5 ])
121
121
index2 = Index ([2 , 4 , 6 ])
122
-
122
+ expected = np . array ( expected , dtype = np . intp )
123
123
if reverse :
124
124
index1 = index1 [::- 1 ]
125
125
expected = expected [::- 1 ]
@@ -166,12 +166,11 @@ def test_get_indexer_nearest(self, method, tolerance, indexer, expected):
166
166
@pytest .mark .parametrize ("listtype" , [list , tuple , Series , np .array ])
167
167
@pytest .mark .parametrize (
168
168
"tolerance, expected" ,
169
- list (
170
- zip (
171
- [[0.3 , 0.3 , 0.1 ], [0.2 , 0.1 , 0.1 ], [0.1 , 0.5 , 0.5 ]],
172
- [[0 , 2 , - 1 ], [0 , - 1 , - 1 ], [- 1 , 2 , 9 ]],
173
- )
174
- ),
169
+ [
170
+ [[0.3 , 0.3 , 0.1 ], [0 , 2 , - 1 ]],
171
+ [[0.2 , 0.1 , 0.1 ], [0 , - 1 , - 1 ]],
172
+ [[0.1 , 0.5 , 0.5 ], [- 1 , 2 , 9 ]],
173
+ ],
175
174
)
176
175
def test_get_indexer_nearest_listlike_tolerance (
177
176
self , tolerance , expected , listtype
0 commit comments