[Numpy-discussion] np.nan and ``is``

Alan G Isaac aisaac@american....
Fri Sep 19 11:59:57 CDT 2008


Might someone explain this to me?

     >>> x = [1.,np.nan]
     >>> np.nan in x
     True
     >>> np.nan in np.array(x)
     False
     >>> np.nan in np.array(x).tolist()
     False
     >>> np.nan is float(np.nan)
     True

Thank you,
Alan Isaac




More information about the Numpy-discussion mailing list