[SciPy-user] Polynomial interpolation

Robert Kern robert.kern at gmail.com
Mon Apr 28 17:24:55 EDT 2008


On Mon, Apr 28, 2008 at 4:21 PM, Eike Welk <eike.welk at gmx.net> wrote:
> On Monday 28 April 2008 22:36, Anne Archibald wrote:
>  > 2008/4/28 Robert Kern <robert.kern at gmail.com>:
>  > >  Well those certainly aren't useful. The only functions I would
>  > >  consider adding would be "one-shot" functions, e.g.:
>  > >
>  > >   def krogh(xi, yi, x):
>  > >       return KroghInterpolator(xi,yi)(x)
>  >
>  > The problem here is that construction of the splines is an order
>  > degree**2 process, so I want an interface that encourages users to
>  > construct them once and for all. I think such an approach also
>  > discourages people from just
>  >
>  > y_interp = krogh(all_my_data_x, all_my_data_y, x_interp)
>  >
>  > with hundreds of points, the results of which will be meaningless
>  > and horrible.
>
>  You could store already constructed interpolation objects in a
>  dictionary. (I didn't test it.):

Arrays are unhashable and cannot be used as dictionary keys.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco



More information about the SciPy-User mailing list