numpy.not_equal()

numpy.not_equal

numpy.not_equal(x1, x2[, out]) =

Return (x1 != x2) element-wise.

Parameters:

x1, x2 : array_like

Input arrays.

out : ndarray, optional

A placeholder the same shape as x1 to store the result. See doc.ufuncs (Section “Output arguments”) for more details.

Returns:

not_equal : ndarray bool, scalar bool

For each element in x1, x2, return True if x1 is not equal to x2 and False otherwise.

Examples

>>> np.not_equal([1.,2.], [1., 3.])
array([False,  True], dtype=bool)
>>> np.not_equal([1, 2], [[1, 3],[1, 4]])
array([[False,  True],
       [False,  True]], dtype=bool)

© 2008–2016 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.not_equal.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部