[Numpy-discussion] nan_to_num and bool arrays

Robert Kern robert.kern at gmail.com
Fri Dec 11 19:07:07 EST 2009


On Fri, Dec 11, 2009 at 18:03, Keith Goodman <kwgoodman at gmail.com> wrote:

> Ack! The "if issubclass(t, _nx.inexact)" fix doesn't work. It solves
> the bool problem but it introduces its own problem since numpy.object_
> is not a subclass of inexact:
>
>>> nan_to_num([np.inf])
>   array([ Inf])

Right. This is the problem I was referring to: "I think that sequences should be
coerced to arrays for output and this check should be more explicit
about what it handles. [1.0] will have a problem if you don't."

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