[SciPy-user] spline interpolation

Christian Kristukat ckkart at hoc.net
Thu Nov 9 20:55:25 CST 2006

Robert Kern wrote:
> Jordan Dawe wrote:
>> I've been looking at scipy's interpolation routines and I can't make
>> heads or tails of them.  I just want to do a spline interp1d like matlab
>> does.  Is there any way to do this?
> I don't know exactly what features you want from Matlab's interp1d, but you
> probably want scipy.interpolate.UnivariateSpline.

I just noticed that UnivariateSpline.derivatives() seems to be broken:

import numpy as N
from scipy.interpolate import UnivariateSpline as spline

fails with:

0-th dimension must be fixed to 8 but got 4
dfitpack.error                                     Traceback (most recent call last)


/usr/local/lib/python2.4/site-packages/scipy/interpolate/fitpack2.py in
derivatives(self, x)
    179     def derivatives(self, x):
    180         """ Return all derivatives of the spline at the point x."""
--> 181         d,ier = dfitpack.spalde(*(self._eval_args+(x,)))
    182         assert ier==0,`ier`
    183         return d

error: failed in converting 2nd argument `c' of dfitpack.spalde to C/Fortran array

with numpy 1.0rc2, scipy 0.5.1 on linux


More information about the SciPy-user mailing list