One-dimensional linear interpolation.
Returns the one-dimensional piecewise linear interpolant to a function with given values at discrete data-points.
Parameters : | x : array_like
xp : 1-D sequence of floats
fp : 1-D sequence of floats
left : float, optional
right : float, optional
|
---|---|
Returns : | y : {float, ndarray}
|
Raises : | ValueError :
|
Notes
Does not check that the x-coordinate sequence xp is increasing. If xp is not increasing, the results are nonsense. A simple check for increasingness is:
np.all(np.diff(xp) > 0)
Examples