From 647ea1908cc33eb2f9fb6c5828cfb895f8663cc0 Mon Sep 17 00:00:00 2001 From: mattip Date: Tue, 29 Oct 2019 23:10:31 +0200 Subject: WIP, DEP, ENH: finish richcompare changes from 1.10 --- numpy/lib/nanfunctions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/nanfunctions.py') 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: -- cgit v1.2.1 From 5c778954cc801fd2272fa6aeb89b85868aa25899 Mon Sep 17 00:00:00 2001 From: mattip Date: Wed, 30 Oct 2019 10:54:51 +0200 Subject: ENH: add OO->? loops, use np.compare(a, b, dtype=bool), add comments --- numpy/lib/nanfunctions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/nanfunctions.py') diff --git a/numpy/lib/nanfunctions.py b/numpy/lib/nanfunctions.py index 0ae74bbbb..457cca146 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).astype(bool) + mask = np.not_equal(a, a, dtype=bool) elif issubclass(a.dtype.type, np.inexact): mask = np.isnan(a) else: -- cgit v1.2.1