[SciPy-user] Re: nan puzzle

Alan G Isaac aisaac at american.edu
Wed Jul 13 12:18:11 EDT 2005


On Wed, 13 Jul 2005, Grant Edwards apparently wrote: 
> What you probably want to be checking is if x has a nan 
> value, not whether x is the same object as some other 
> object that has a nan value. 

How?  (See below.)

Anyway, now I cannot replicate the problem.
I did post a cut and paste, but I cannot reproduce it.
Also I recall having to type something that did not come 
with the cut, so the post must be suspect until I can 
replicate.  I'll repost if I find can.
Until then, sorry for the noise.

I'll plan on using isnan().
Thanks for the feedback.

Alan


Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from scipy import *
>>> x=nan
>>> x is nan
True
>>> isnan(x)
1
>>> x == nan
False
>>> z = [0,1,nan,3]
>>> z[2] is nan
True
>>> x = z[2]
>>> x is nan
True
>>>





More information about the SciPy-User mailing list