MCPcopy Index your code
hub / github.com/numpy/numpy / equal

Function equal

numpy/_core/defchararray.py:62–92  ·  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

60
61@array_function_dispatch(_binary_op_dispatcher)
62def equal(x1, x2):
63 """
64 Return (x1 == x2) element-wise.
65
66 Unlike `numpy.equal`, this comparison is performed by first
67 stripping whitespace characters from the end of the string. This
68 behavior is provided for backward-compatibility with numarray.
69
70 Parameters
71 ----------
72 x1, x2 : array_like of str or unicode
73 Input arrays of the same shape.
74
75 Returns
76 -------
77 out : ndarray
78 Output array of bools.
79
80 Examples
81 --------
82 >>> import numpy as np
83 >>> y = "aa "
84 >>> x = "aa"
85 >>> np.char.equal(x, y)
86 array(True)
87
88 See Also
89 --------
90 not_equal, greater_equal, less_equal, greater, less
91 """
92 return compare_chararrays(x1, x2, '==', True)
93
94
95@array_function_dispatch(_binary_op_dispatcher)

Callers 7

__eq__Method · 0.90
test_basic_ufuncsMethod · 0.90
__eq__Method · 0.85
masked_equalFunction · 0.85
test_testUfuncs1Method · 0.85
test_testOddFeaturesMethod · 0.85

Calls

no outgoing calls

Tested by 4

test_basic_ufuncsMethod · 0.72
test_testUfuncs1Method · 0.68
test_testOddFeaturesMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…