[SciPy-user] nan puzzle

Robert Kern rkern at ucsd.edu
Tue Jul 12 23:52:04 EDT 2005


Andrew Straw wrote:
> I haven't used it, but the fpconst module is supposed to deal with this 
> situation.
> 
> e.g. fpconst.isNaN(val)
> 
> fpconst home:
> http://research.warnes.net/projects/RStatServer/fpconst/
> 
> The draft PEP:
> http://www.python.org/peps/pep-0754.html

Well, scipy.isnan() usually works, too. The real issue seems to be that 
the "is" operator isn't working correctly. "is" compares the underlying 
PyObject* pointers and shouldn't be touching the floating point value at 
all. I can't replicate it on OS X, so it's probably Windows-specific. 
Alan, is what you wrote a direct cut-and-paste of the actual session?

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter




More information about the SciPy-User mailing list