[SciPy-User] cubic spline interpolation with scipy.interpolate.interp1d

Pauli Virtanen pav@iki...
Sat Mar 19 15:16:15 CDT 2011


On Sun, 20 Mar 2011 00:27:19 +0530, Jaidev Deshpande wrote:
> The scipy.interpolate.interp1d class generates an interpolation object
> which I find to be somewhat sluggish and also a little unnecessary.
> 
> Are there alternatives that will simply produce an array?

Computing a spline interpolant requires solving for the spline 
coefficients. This step takes some time, and storing the coefficients 
somewhere cannot be avoided, because spline interpolation is global.

Whether the spline coefficients are stored for later use or thrown away 
immediately will not likely affect the performance much. You can try 
using the low-level functions `splrep` and `splev`, but this will 
probably not be much faster.

-- 
Pauli Virtanen



More information about the SciPy-User mailing list