diff options
author | Jay Bourque <jay.bourque@continuum.io> | 2013-05-10 15:32:24 -0500 |
---|---|---|
committer | Jay Bourque <jay.bourque@continuum.io> | 2013-05-10 15:32:24 -0500 |
commit | 6dc709a5aa0b17b5a74b7456d7cbd2580d9063f6 (patch) | |
tree | b8891ddafcd824f1082da92e702d47ea1ba0d912 /numpy/core/numeric.py | |
parent | 6b892cf994889518a948987be8c57353d4250dad (diff) | |
download | numpy-6dc709a5aa0b17b5a74b7456d7cbd2580d9063f6.tar.gz |
Fix array_equal and array_equiv issue
array_equal() and array_equiv() don't work for string arrays and record arrays. This is because those methods use numpy.equals ufunc for comparison, and there are no equal ufuncs registered for strings and record arrays. Replace numpy.equals with '==' array operation, which handles strings and record arrays.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index d689982db..a20bf3dcd 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -2137,7 +2137,7 @@ def array_equal(a1, a2): return False if a1.shape != a2.shape: return False - return bool(equal(a1,a2).all()) + return bool((a1 == a2).all()) def array_equiv(a1, a2): """ @@ -2179,7 +2179,7 @@ def array_equiv(a1, a2): except: return False try: - return bool(equal(a1,a2).all()) + return bool(asarray(a1 == a2).all()) except ValueError: return False |