bundles / numpy 2.4.3 / numpy / char / equal
_ArrayFunctionDispatcher
numpy.char:equal
source: /numpy/_core/defchararray.py:61
Signature
def equal(x1, x2)Summary
Return (x1 == x2) element-wise.
Extended Summary
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 or unicodeInput arrays of the same shape.
Returns
out: ndarrayOutput array of bools.
Examples
import numpy as np y = "aa " x = "aa" np.char.equal(x, y)✓
array(True)
See also
Aliases
numpy.char.equal