Finding a cubic spline that interpolates a set of data
In this recipe, we will look at how to find a cubic spline that interpolates with the main method of spline.
Getting ready
We will need to follow some instructions and install the prerequisites.
How to do it…
We can use the following functions to solve the problems with this parameter:
x
:array_like
,shape (n,)
. A 1D array containing values of the independent variable. The values must be real, finite, and in strictly increasing order.y
:array_like
. An array containing values of the dependent variable. It can have an arbitrary number of dimensions, but the length alongaxis
must match the length ofx
. The values must be finite.axis
:int
; optional. The axis along whichy
is assumed to be varying, meaning for x[i], the corresponding values arenp.take(y, i, axis=axis)
. The default is0
.bc_type
: String or two-tuple; optional. Boundary condition type. Two additional equations, given by the boundary conditions, are required to determine all coefficients...