Skip to content Skip to sidebar Skip to footer

Scipy Pchipinterpolator Implementation Problems

I am trying to implement PchipInterpolator based on the link: http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.interpolate.PchipInterpolator.html The code I am usin

Solution 1:

PchipInterpolator was refactored in version 0.14, and that's when it has grown the extrapolate keyword.

Compare the docs for the version 0.13: http://docs.scipy.org/doc/scipy-0.13.0/reference/generated/scipy.interpolate.PchipInterpolator.html

and version 0.14: http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.interpolate.PchipInterpolator.html

(disclaimer: I was involved in that refactor)

Scipy 0.13 is quite old by now, best consider upgrading.

More recent scipy versions are slightly better in terms of consistency in interpolate. For one, all polynomial-based interpolators (PPoly, BPoly, Pchip and Akima) have the extrapolate keyword.

Solution 2:

Try this:

from scipy import interpolate
import numpy as np


x = np.arange(0, 10)
y = np.exp(-x/3.0)
set_interp  =   interpolate.PchipInterpolator( x, y, extrapolate=True )

I got no error

Post a Comment for "Scipy Pchipinterpolator Implementation Problems"