From 83fb19e7f37502df72d4c4865138f7d84de7c517 Mon Sep 17 00:00:00 2001 From: Marten van Kerkwijk Date: Sun, 13 Oct 2013 22:39:40 -0400 Subject: Ensure masked arrays are treated correctly for isclose(..,..,equal_nan=True) --- numpy/core/numeric.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'numpy/core/numeric.py') diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 1aa59ce58..53254ec6a 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -2216,7 +2216,8 @@ def isclose(a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False): cond[~finite] = (x[~finite] == y[~finite]) if equal_nan: # Make NaN == NaN - cond[isnan(x) & isnan(y)] = True + both_nan = isnan(x) & isnan(y) + cond[both_nan] = both_nan[both_nan] return cond def array_equal(a1, a2): -- cgit v1.2.1