VOOZH about

URL: https://www.geeksforgeeks.org/python/numpy-not_equal-python/

⇱ numpy.not_equal() in Python - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

numpy.not_equal() in Python

Last Updated : 3 Jun, 2024

The numpy.not_equal() checks whether two element are unequal or not.

Syntax : 

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

Parameters : 

x1, x2 : [array_like]Input Array whose elements we want to check
out : [ndarray, optional]Output array that returns True/False.
A placeholder the same shape as x1 to store the result.

Return : 

Boolean array 

Code 1 : 

Output : 

Not equal : 
[False True]

Not equal :
[[False True]
[False True]]

Code 2 : 

Output : 

Comparing complex with int using .not_equal() : [ True False]

Code 3 : 

Output : 

 Comparing float with int using .not_equal() : [ True True]
Comment