[SciPy-user] spline interpolation

Jordan Dawe jdawe at eos.ubc.ca
Thu Nov 9 17:14:26 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 want a cubic spline fit that passes through every point it is fit to.  I
haven't been able to figure out how to make UnivariateSpline do this; it
goes near the points, but is not constrained to satisfy the points exactly.
Matlab does this by a series of piecewise spline interpolations that are
continuous in the first two derivatives at each data point.

Matlab's man page:


I believe it is essentially implementing the cubic spline interpolation
algorithm from Numerical Recipes:


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20061109/3f347c24/attachment.html 

More information about the SciPy-user mailing list