[SciPy-user] Interpolate 1D

A. M. Archibald peridot.faceted at gmail.com
Tue Sep 5 10:29:49 CDT 2006


On 05/09/06, Maik Trömel <maik.troemel at maitro.net> wrote:
> Hello list,
>
> when I try to use scipy.interpolate.interpolate.interp1d( olddims[-1],
> a, kind='cubic' ) I get an ERROR:
>
> File
> "/usr/lib/python2.3/site-packages/scipy/interpolate/interpolate.py",
> line 118, in __init__
>     raise NotImplementedError, "Only linear supported for now. Use "\
> NotImplementedError: Only linear supported for now. Use fitpack routines
> for other types.
>
> But under
> http://www.scipy.org/doc/api_docs/scipy.interpolate.interpolate.interp1d.html
> kind = 'cubic' is listed. Whats wrong with the command? Or is cubic not
> implemented yet?
>
> Thanks for your help!

It seems not to be implemented, but you can use
scipy.interpolate.fitpack2.InterpolatedUnivariateSpline to do the same
thing for splines (of various orders). I think it also provides all
the handy extras like derivatives and root-finding. It doesn't seem to
be able to raise exceptions or insert NaNs for out-of-bound values, it
just extrapolates. But otherwise it seems to be the right tool for the
job.

A. M. Archibald


More information about the SciPy-user mailing list