numpy.isnan(value) not the same as value == numpy.nan? numpy.isnan(value) not the same as value == numpy.nan? numpy numpy

numpy.isnan(value) not the same as value == numpy.nan?


nan != nan. That's just how equality comparisons on nan are defined. It was decided that this result is more convenient for numerical algorithms than the alternative. This is specifically why isnan exists.