> On Fri, Sep 19, 2008 at 1:59 PM, Alan G Isaac <[EMAIL PROTECTED]> wrote: >> 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
On 9/19/2008 1:15 PM Lisandro Dalcin apparently wrote: > I do not remember right now the implementations of comparisons in core > Python, but I believe the 'in' operator is testing first for object > identity, and then 'np.nan in [np.nan]' then returns True, and then > the fact that 'np.nan==np.nan' returns False is never considered. Sure. All evaluations to True make sense to me. I am asking about the ones that evaluate to False. Thanks, Alan _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion