[Numpy-discussion] isnan surprise

Robert Kern robert.kern at gmail.com
Sun May 25 16:25:49 EDT 2008


On Sun, May 25, 2008 at 1:17 PM, Keith Goodman <kwgoodman at gmail.com> wrote:
> On Sun, May 25, 2008 at 11:13 AM, Keith Goodman <kwgoodman at gmail.com> wrote:
>>>> x = np.array([1.0])
>>>> np.isnan(x)
>>   array([False], dtype=bool)  # <----- Expected
>>>> np.isnan(x,x)
>>   array([ 0.])  # <----- Surprise (to me)
>
> I guess this is not surprising since I'm asking isnan to put the
> answer in a float array.

Correct.

-- 
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



More information about the NumPy-Discussion mailing list