dpnp.not_equal
- dpnp.not_equal(x1, x2, /, out=None, *, order='K', where=True, dtype=None, subok=True, **kwargs)[source]
Return the truth value of (x1 != x2) element-wise.
For full documentation refer to
numpy.not_equal.- Returns:
out – Output array of bool type, element-wise comparison of x1 and x2.
- Return type:
dpnp.ndarray
Limitations
Parameters x1 and x2 are supported as either scalar,
dpnp.ndarrayordpctl.tensor.usm_ndarray, but both x1 and x2 can not be scalars at the same time. Parameters where, dtype and subok are supported with their default values. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types.See also
dpnp.equalReturn (x1 == x2) element-wise.
dpnp.greaterReturn the truth value of (x1 > x2) element-wise.
dpnp.greater_equalReturn the truth value of (x1 >= x2) element-wise.
dpnp.lessReturn the truth value of (x1 < x2) element-wise.
dpnp.less_equalReturn the truth value of (x1 =< x2) element-wise.
Examples
>>> import dpnp as np >>> x1 = np.array([1., 2.]) >>> x2 = np.arange(1., 3.) >>> np.not_equal(x1, x2) array([False, False])
The
!=operator can be used as a shorthand fornot_equalondpnp.ndarray.>>> a = np.array([1., 2.]) >>> b = np.array([1., 3.]) >>> a != b array([False, True])