[Numpy-discussion] detecting a nan with all() or any()

Vasileios Gkinis v.gkinis@gfy.ku...
Tue Oct 21 10:30:23 CDT 2008


I would like to detect if my array for example a = array((1,2,3,nan)) 
contains any nans
So when i use:
In [31]: all(a!=nan)
I get
Out[31]: True
And when i use:
In [35]: any(a==nan)
I get
Out[35]: False
Which looks rather wrong to me...or i am simply missing something
Can somebody comment on that...?




Vasileios Gkinis, PhD Student

Centre for Ice and Climate

Niels Bohr Institute

Juliane Maries Vej 30, room 321

DK-2100 Copenhagen


Office: +45 35325913


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20081021/fea172b1/attachment.html 

More information about the Numpy-discussion mailing list