summaryrefslogtreecommitdiff
path: root/numpy/lib/arraysetops.py
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2019-10-30 10:54:51 +0200
committermattip <matti.picus@gmail.com>2019-10-30 10:54:51 +0200
commit5c778954cc801fd2272fa6aeb89b85868aa25899 (patch)
tree04424c7de5ce68c0e480924418511eb1c36861a1 /numpy/lib/arraysetops.py
parent647ea1908cc33eb2f9fb6c5828cfb895f8663cc0 (diff)
downloadnumpy-5c778954cc801fd2272fa6aeb89b85868aa25899.tar.gz
ENH: add OO->? loops, use np.compare(a, b, dtype=bool), add comments
Diffstat (limited to 'numpy/lib/arraysetops.py')
-rw-r--r--numpy/lib/arraysetops.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
index c30ad534b..cf45e181b 100644
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -562,10 +562,14 @@ def in1d(ar1, ar2, assume_unique=False, invert=False):
if invert:
mask = np.ones(len(ar1), dtype=bool)
for a in ar2:
+ # convert object arrays to bool
+ # cannot use np.not_equal until 'S' and 'U' have loops
mask &= (ar1 != a).astype(bool)
else:
mask = np.zeros(len(ar1), dtype=bool)
for a in ar2:
+ # convert object arrays to bool
+ # cannot use np.equal until 'S' and 'U' have loops
mask |= (ar1 == a).astype(bool)
return mask