[SciPy-User] Linear Interpolation

denis denis-bz-gg@t-online...
Sat Jul 21 04:30:53 CDT 2012

On 19/07/2012 03:39, Tom Harris wrote:
> Greetings.
> I would like some help in linear interpolation. Not in doing the
> interpolation, but in choosing the points for the interpolation (are
> these called interpolants?).

The jargon is "knots";
     interpolator = UnivariateSpline( x, y, k=1, s=0 )  # s=0 interpolates
     print "knots:", interpolator.get_knots()

For fast simple quadratic interpolation in C
(not your question, but quadratic is much smoother than linear
and cheaper than cubic), see
It's for regularly-spaced x_i; for arbitrary spacing, first binary search.

You might try

   -- denis

More information about the SciPy-User mailing list