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)
| 60 | |
| 61 | @array_function_dispatch(_binary_op_dispatcher) |
| 62 | def 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) |
no outgoing calls
searching dependent graphs…