Skip to content

Commit 6d026b2

Browse files
committed
fixing minor issues with tests
1 parent c952d68 commit 6d026b2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/tests/libs/test_hashtable.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def test_lookup(self, table_type, dtype):
7676
table.map_locations(keys)
7777
result = table.lookup(keys)
7878
expected = np.arange(N)
79-
tm.assert_numpy_array_equal(result, expected)
79+
tm.assert_numpy_array_equal(result.astype(np.int64), expected.astype(np.int64))
8080

8181
def test_lookup_wrong(self, table_type, dtype):
8282
if dtype in (np.int8, np.uint8):
@@ -184,7 +184,7 @@ def test_duplicated_first(self, dtype, type_suffix):
184184
duplicated = get_ht_function("duplicated", type_suffix)
185185
values = np.repeat(np.arange(N).astype(dtype), 5)
186186
result = duplicated(values)
187-
expected = np.ones_like(values, dtype=np.bool)
187+
expected = np.ones_like(values, dtype=np.bool_)
188188
expected[::5] = False
189189
tm.assert_numpy_array_equal(result, expected)
190190

@@ -194,7 +194,7 @@ def test_ismember_yes(self, dtype, type_suffix):
194194
arr = np.arange(N).astype(dtype)
195195
values = np.arange(N).astype(dtype)
196196
result = ismember(arr, values)
197-
expected = np.ones_like(values, dtype=np.bool)
197+
expected = np.ones_like(values, dtype=np.bool_)
198198
tm.assert_numpy_array_equal(result, expected)
199199

200200
def test_ismember_no(self, dtype, type_suffix):
@@ -203,7 +203,7 @@ def test_ismember_no(self, dtype, type_suffix):
203203
arr = np.arange(N).astype(dtype)
204204
values = (np.arange(N) + N).astype(dtype)
205205
result = ismember(arr, values)
206-
expected = np.zeros_like(values, dtype=np.bool)
206+
expected = np.zeros_like(values, dtype=np.bool_)
207207
tm.assert_numpy_array_equal(result, expected)
208208

209209
def test_mode(self, dtype, type_suffix):
@@ -247,15 +247,15 @@ def test_ismember_yes(self, dtype, type_suffix):
247247
arr = np.array([np.nan, np.nan, np.nan], dtype=dtype)
248248
values = np.array([np.nan, np.nan], dtype=dtype)
249249
result = ismember(arr, values)
250-
expected = np.array([True, True, True], dtype=np.bool)
250+
expected = np.array([True, True, True], dtype=np.bool_)
251251
tm.assert_numpy_array_equal(result, expected)
252252

253253
def test_ismember_no(self, dtype, type_suffix):
254254
ismember = get_ht_function("ismember", type_suffix)
255255
arr = np.array([np.nan, np.nan, np.nan], dtype=dtype)
256256
values = np.array([1], dtype=dtype)
257257
result = ismember(arr, values)
258-
expected = np.array([False, False, False], dtype=np.bool)
258+
expected = np.array([False, False, False], dtype=np.bool_)
259259
tm.assert_numpy_array_equal(result, expected)
260260

261261
def test_mode(self, dtype, type_suffix):

0 commit comments

Comments
 (0)