summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2019-10-29 23:10:31 +0200
committermattip <matti.picus@gmail.com>2019-10-29 23:10:31 +0200
commit647ea1908cc33eb2f9fb6c5828cfb895f8663cc0 (patch)
tree2da5d0f07adecdad06af1b44ced5e59f42ac41f5 /numpy/lib
parent117220ff29bcbc85bc888f8590d3653a9e9808f4 (diff)
downloadnumpy-647ea1908cc33eb2f9fb6c5828cfb895f8663cc0.tar.gz
WIP, DEP, ENH: finish richcompare changes from 1.10
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/arraysetops.py4
-rw-r--r--numpy/lib/nanfunctions.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
index 2309f7e42..c30ad534b 100644
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -562,11 +562,11 @@ def in1d(ar1, ar2, assume_unique=False, invert=False):
if invert:
mask = np.ones(len(ar1), dtype=bool)
for a in ar2:
- mask &= (ar1 != a)
+ mask &= (ar1 != a).astype(bool)
else:
mask = np.zeros(len(ar1), dtype=bool)
for a in ar2:
- mask |= (ar1 == a)
+ mask |= (ar1 == a).astype(bool)
return mask
# Otherwise use sorting
diff --git a/numpy/lib/nanfunctions.py b/numpy/lib/nanfunctions.py
index 18ccab3b8..0ae74bbbb 100644
--- a/numpy/lib/nanfunctions.py
+++ b/numpy/lib/nanfunctions.py
@@ -99,7 +99,7 @@ def _replace_nan(a, val):
if a.dtype == np.object_:
# object arrays do not support `isnan` (gh-9009), so make a guess
- mask = a != a
+ mask = (a != a).astype(bool)
elif issubclass(a.dtype.type, np.inexact):
mask = np.isnan(a)
else: