diff options
author | MilesCranmer <miles.cranmer@gmail.com> | 2022-06-22 17:00:38 -0400 |
---|---|---|
committer | MilesCranmer <miles.cranmer@gmail.com> | 2022-06-22 17:00:38 -0400 |
commit | 6244c0631e1a78926db27143bf936bfb5e95c852 (patch) | |
tree | 111521185ca7edba1bcef2ee59011d90d3013191 /numpy/lib/arraysetops.py | |
parent | c4aa5d8356c0f76550d17b27f034c2c19ffc1767 (diff) | |
download | numpy-6244c0631e1a78926db27143bf936bfb5e95c852.tar.gz |
MAINT: Fix edgecase for bool containers
Diffstat (limited to 'numpy/lib/arraysetops.py')
-rw-r--r-- | numpy/lib/arraysetops.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py index e10700785..9a44d7e44 100644 --- a/numpy/lib/arraysetops.py +++ b/numpy/lib/arraysetops.py @@ -623,9 +623,9 @@ def in1d(ar1, ar2, assume_unique=False, invert=False, *, kind=None): ar2 = ar2.reshape(-1, 1) # Convert booleans to uint8 so we can use the fast integer algorithm if ar1.dtype == bool: - ar1 = ar1.view(np.uint8) + ar1 = ar1 + np.uint8(0) if ar2.dtype == bool: - ar2 = ar2.view(np.uint8) + ar2 = ar2 + np.uint8(0) # Check if we can use a fast integer algorithm: integer_arrays = (np.issubdtype(ar1.dtype, np.integer) and |