From: Andrew S. <str...@as...> - 2006-03-20 18:40:50
|
Darren Dale wrote: >Here's a bug: I need isnan to create my mask. It is provided by numerix with >numpy and numarray, but not Numeric. Can this be rectified? > > I just added the matplotlib._isnan extension module which is independent of the numerix choice (although I think it'll be better to stick with a numerix-given function, if available). Below is an example of its use. Perhaps you can modify the Numeric-flavor numerix so that isnan is exposed the same way as numarray and numpy -- I didn't do this because you'll be more familiar with the details than I am. #Example: import matplotlib._isnan as n import numpy for val in [3.2,3,numpy.nan,'adsf']: print 'val',val print n.isnan64(val) print Running displays the following: val 3.2 False val 3 False val nan True val adsf Traceback (most recent call last): File "testnan.py", line 6, in ? print n.isnan64(val) TypeError: a float is required |