[Numpy-discussion] How do I test if an array contains NaN ?

Christopher Barker Chris.Barker at noaa.gov
Thu Jan 4 17:51:40 CST 2007



Fernando Perez wrote:

> It's probably worth mentioning that IPython has (thanks to a user
> contributed implementation) search capabilities besides tab completion

very handy.

And if you're an idiot like me that for some unknown reason still does 
not use ipython, you can always do:

for i in dir(N):
     if "nan" in i: print i

 >>> import numpy as N
 >>> for i in dir(N):
...     if "nan" in i: print i
...
isnan
nan
nan_to_num
nanargmax
nanargmin
nanmax
nanmin
nansum

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the Numpy-discussion mailing list