[SciPy-Dev] empty input to spline from UnivariateSpline

Ralf Gommers ralf.gommers at googlemail.com
Wed Jul 28 09:59:39 EDT 2010


On Wed, Jul 28, 2010 at 6:55 PM, Pauli Virtanen <pav at iki.fi> wrote:

> Wed, 28 Jul 2010 18:36:12 +0800, Ralf Gommers wrote:
> > In ticket http://projects.scipy.org/scipy/ticket/1014 there is a request
> > to return an empty array instead of getting an error when an empty array
> > is passed to the spline object generated by UnivariateSpline. This is
> > easy to fix, but is it the desired behavior? The submitter wants an
> > empty array, maybe other users would want an exception. Change this or
> > not?
>
> x = UnivariateSpline(...)
> x([]) == np.array([])
>
> is the correct behavior, IMO. The user is asking for the interpolant
> evaluated at 0 input points -- so the correct result is the interpolant
> at 0 input points, i.e., an empty array.
>
> That's what we do with sin, cos, and other ufuncs, and since the
> interpolant is also essentially a function, it should behave in the same
> way.
>
> Makes sense. Done in r6642.

Cheers,
Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20100728/a8f36a52/attachment.html>


More information about the SciPy-Dev mailing list