summaryrefslogtreecommitdiff
path: root/numpy/lib/nanfunctions.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2019-11-04 17:32:10 -0700
committerGitHub <noreply@github.com>2019-11-04 17:32:10 -0700
commit4393e0c0cb1772d0f9691117d238d000b209decd (patch)
tree5dda9c9a885af59ecdcd4c3c947e69bd6bab48bf /numpy/lib/nanfunctions.py
parent7b8513fff4c3673d8a967a1d72a73feab2072e8f (diff)
parent9aa8c4756d7282dd49a7093ce7a6725258106b9a (diff)
downloadnumpy-4393e0c0cb1772d0f9691117d238d000b209decd.tar.gz
Merge pull request #14800 from mattip/reorder-obj-comparison-loop
ENH: change object-array comparisons to prefer OO->O unfuncs
Diffstat (limited to 'numpy/lib/nanfunctions.py')
-rw-r--r--numpy/lib/nanfunctions.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/nanfunctions.py b/numpy/lib/nanfunctions.py
index 18ccab3b8..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
+ mask = np.not_equal(a, a, dtype=bool)
elif issubclass(a.dtype.type, np.inexact):
mask = np.isnan(a)
else: