np.isnan() == False, but np.isnan() is not False
As far as I understand it, == checks for equality of value, and is checks for identity of structure behind value (as, say === in some other languages). Given that, I don't understand the following: np.isnan(30) == False Out[19]: True np.isnan(30) is False Out[20]: False It appears not to be the case with other identity checks: (5 == 4) == False Out[22]: True (5 == 4) is False Out[23]: True It appears as if np.isnan() returns False as a value, but not as identity. Why is that the case? numpy.isnan() returns a compatible type object: >>> import numpy >>> type(numpy.isnan(0)) <class 'numpy.bool_'