[SciPy-user] Polynomial interpolation
Mon Apr 28 15:26:17 CDT 2008
On Mon, Apr 28, 2008 at 3:11 PM, Anne Archibald
> 2008/4/28 Robert Kern <email@example.com>:
> > On Mon, Apr 28, 2008 at 12:17 PM, Gael Varoquaux
> > <firstname.lastname@example.org> wrote:
> > > I am not suggesting to make a bad design choice, or to go
> > > out of our way, I just want a two liner helper function.
> > I'm afraid that *is* widely recognized as a bad design choice.
> Well, I think the way to go is to mimic splrep/splev:
> def krogh_rep(xi, yi):
> return KroghInterpolator(xi, yi)
> def krogh_ev(kr, x, der=0):
> if der==0:
> return kr(x)
> return kr.derivative(x, der=der)
> The only danger is that if it ever raises an exception and the users
> see how simple it is they will feel like idiots.
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):
"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