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

Function not_equal

numpy/_core/defchararray.py:96–126  ·  view source on GitHub ↗

Return (x1 != x2) element-wise. Unlike `numpy.not_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

(x1, x2)

Source from the content-addressed store, hash-verified

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

Callers 7

__ne__Method · 0.90
test_basic_ufuncsMethod · 0.90
__ne__Method · 0.85
masked_not_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…