Why am I getting the following:
>>> v nan >>> type(v) <type 'numpy.float64'> >>> v == np.nan False >>> np.isnan(v) True
I would think that they should be equivalent?
nan != nan . This is how equalities on nan are defined. It was decided that this result is more convenient for numerical algorithms than the alternative. That is why there isnan .
nan != nan
nan
isnan