MCPcopy Create free account
hub / github.com/numpy/numpy / equal

Function equal

numpy/core/defchararray.py:105–127  ·  view source on GitHub ↗

Return (x1 == x2) element-wise. Unlike `numpy.equal`, this comparison is performed by first stripping whitespace characters from the end of the string. This behavior is provided for backward-compatibility with numarray. Parameters ---------- x1, x2 : array_like of str

(x1, x2)

Source from the content-addressed store, hash-verified

103
104@array_function_dispatch(_binary_op_dispatcher)
105def equal(x1, x2):
106 """
107 Return (x1 == x2) element-wise.
108
109 Unlike `numpy.equal`, this comparison is performed by first
110 stripping whitespace characters from the end of the string. This
111 behavior is provided for backward-compatibility with numarray.
112
113 Parameters
114 ----------
115 x1, x2 : array_like of str or unicode
116 Input arrays of the same shape.
117
118 Returns
119 -------
120 out : ndarray
121 Output array of bools.
122
123 See Also
124 --------
125 not_equal, greater_equal, less_equal, greater, less
126 """
127 return compare_chararrays(x1, x2, '==', True)
128
129
130@array_function_dispatch(_binary_op_dispatcher)

Callers 7

__eq__Method · 0.90
test_basic_ufuncsMethod · 0.90
__eq__Method · 0.70
masked_equalFunction · 0.50
test_testUfuncs1Method · 0.50
test_testOddFeaturesMethod · 0.50

Calls 1

compare_chararraysFunction · 0.85

Tested by 4

test_basic_ufuncsMethod · 0.72
test_testUfuncs1Method · 0.40
test_testOddFeaturesMethod · 0.40