diff options
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/arraysetops.py | 12 | ||||
-rw-r--r-- | numpy/lib/tests/test_arraysetops.py | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py index 90b5f0419..6d7d1c397 100644 --- a/numpy/lib/arraysetops.py +++ b/numpy/lib/arraysetops.py @@ -608,9 +608,9 @@ def in1d(ar1, ar2, assume_unique=False, invert=False, method='auto'): if ar2.dtype == object: ar2 = ar2.reshape(-1, 1) # Convert booleans to uint8 so we can use the fast integer algorithm - if ar1.dtype == np.bool_: + if ar1.dtype == bool: ar1 = ar1.view(np.uint8) - if ar2.dtype == np.bool_: + if ar2.dtype == bool: ar2 = ar2.view(np.uint8) # Check if we can use a fast integer algorithm: @@ -647,16 +647,16 @@ def in1d(ar1, ar2, assume_unique=False, invert=False, method='auto'): if optimal_parameters or method == 'dictionary': if invert: - outgoing_array = np.ones_like(ar1, dtype=np.bool_) + outgoing_array = np.ones_like(ar1, dtype=bool) else: - outgoing_array = np.zeros_like(ar1, dtype=np.bool_) + outgoing_array = np.zeros_like(ar1, dtype=bool) # Make elements 1 where the integer exists in ar2 if invert: - isin_helper_ar = np.ones(ar2_range + 1, dtype=np.bool_) + isin_helper_ar = np.ones(ar2_range + 1, dtype=bool) isin_helper_ar[ar2 - ar2_min] = 0 else: - isin_helper_ar = np.zeros(ar2_range + 1, dtype=np.bool_) + isin_helper_ar = np.zeros(ar2_range + 1, dtype=bool) isin_helper_ar[ar2 - ar2_min] = 1 # Mask out elements we know won't work diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py index e4f37556a..d54ca1673 100644 --- a/numpy/lib/tests/test_arraysetops.py +++ b/numpy/lib/tests/test_arraysetops.py @@ -454,7 +454,7 @@ class TestSetOps: # This hits it without the use of method='dictionary' a = np.array([5, 4, 5, 3, 4, 4, 1e9], dtype=np.int64) b = np.array([2, 3, 4, 1e9], dtype=np.int64) - expected = np.array([0, 1, 0, 1, 1, 1, 1], dtype=np.bool) + expected = np.array([0, 1, 0, 1, 1, 1, 1], dtype=bool) assert_array_equal(expected, in1d(a, b)) assert_array_equal(np.invert(expected), in1d(a, b, invert=True)) |