__init__(self,
x,
y,
kind=' linear ' ,
axis=-1,
makecopy=0,
bounds_error=1,
fill_value=None)
(Constructor)
| source code
|
Initialize a 1d piecewise-linear interpolation class
Description:
x and y are arrays of values used to approximate some function f:
y = f(x)
This class returns a function whose call method uses linear
interpolation to find the value of new points.
Inputs:
x -- a 1d array of monotonically increasing real values.
x cannot include duplicate values. (otherwise f is
overspecified)
y -- an nd array of real values. y's length along the
interpolation axis must be equal to the length
of x.
kind -- specify the kind of interpolation: 'nearest', 'linear',
'cubic', or 'spline'
axis -- specifies the axis of y along which to
interpolate. Interpolation defaults to the last
axis of y. (default: -1)
makecopy -- If 1, the class makes internal copies of x and y.
If 0, references to x and y are used. The default
is NOT to copy. (default: 0)
bounds_error -- If 1, an error is thrown any time interpolation
is attempted on a value outside of the range
of x (where extrapolation is necessary).
If 0, out of bounds values are assigned the
NaN (#INF) value. By default, an error is
raised, although this is prone to change.
(default: 1)
- Overrides:
object.__init__
|