[NumPy-Tickets] [NumPy] #2095: np.array_equal does not works for string arrays
NumPy Trac
numpy-tickets@scipy....
Fri Mar 30 08:48:34 CDT 2012
#2095: np.array_equal does not works for string arrays
--------------------------+-------------------------------------------------
Reporter: shima__shima | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: numpy.core | Version: 1.6.1
Keywords: |
--------------------------+-------------------------------------------------
if dtype of arrays are string, such as '|S10', np.array_equal does not
work.
This function is implemented as follows:
numpy/core/numeric.py, line 1966
return bool(logical_and.reduce(equal(a1,a2).ravel()))
However, np.equal is not implemented for strings. This issue can be
avoided by replacing this line by
return bool(logical_and.reduce((a1 == a2).ravel()))
The same issue occurs in array_equiv at line 2008.
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/2095>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list