Computing a polynomial interpolation for a set of data points
In this recipe, we will look at how to compute data polynomial interpolation by applying some important methods which are discussed in detail in the coming How to do it... section.
Getting ready
We will need to follow some instructions and install the prerequisites.
How to do it…
Let's get started. In the following steps, we will explain how to compute a polynomial interpolation and the things we need to know:
They require the following parameters:
points
: Anndarray
of floats,shape (n, D)
data point coordinates. It can be either an array ofshape (n, D)
or a tuple ofndim
arrays.values
: Anndarray
of float or complexshape (n,)
data values.xi
: A 2Dndarray
of float or tuple of 1D array,shape (M, D)
. Points at which to interpolate data.method
: A{'linear', 'nearest', 'cubic'}
—This is an optional method of interpolation.
One of the nearest return value is at the data point closest to the point of interpolation. See NearestNDInterpolator...