On Tue, Oct 21, 2008 at 10:30, Vasileios Gkinis <[EMAIL PROTECTED]> wrote: > Hi, > > 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...?
One of the properties of nans is that nan!=nan. Instead, use the function isnan(). -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion