[Numpy-discussion] suggested change of behavior for interp

Charles R Harris charlesr.harris@gmail....
Tue Jun 4 19:05:24 CDT 2013


On Tue, Jun 4, 2013 at 12:07 PM, Slavin, Jonathan
<jslavin@cfa.harvard.edu>wrote:

> Hi,
>
> I would like to suggest that the behavior of numpy.interp be changed
> regarding treatment of situations in which the x-coordinates are not
> monotonically increasing.  Specifically, it seems to me that interp should
> work correctly when the x-coordinate is decreasing monotonically.  Clearly
> it cannot work if the x-coordinate is not monotonic, but in that case it
> should raise an exception.  Currently if x is not increasing it simply
> silently fails, providing incorrect values.  This fix could be as simple as
> a monotonicity test and inversion if necessary (plus a raise statement for
> non-monotonic cases).
>
>
Seems reasonable, although it might add a bit of execution time.

Chuck

>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20130604/25526df7/attachment.html 


More information about the NumPy-Discussion mailing list