[Numpy-discussion] clip() with None as argument

Robert Kern robert.kern at gmail.com
Tue Sep 7 16:22:45 EDT 2010


On Tue, Sep 7, 2010 at 15:12, Friedrich Romstedt
<friedrichromstedt at gmail.com> wrote:
> Ah, no need to answer, I do this myself:
>
> Friedrich, would you please use numpy.inf and -numpy.inf.

But if you have an integer array, you will run into the same problem.
The result will be upcast to float. I think we would accept a patch
that interprets None to be the appropriate extreme bound given the
input datatype. This will be tricky, though, since it must be done in
C (PyArray_Clip in numpy/core/src/multiarray/calculation.c).

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