pandas 1.4.2

ParametersReturns
_cubicspline_interpolate(xi, yi, x, axis=0, bc_type='not-a-knot', extrapolate=None)

See scipy.interpolate.CubicSpline for details.

Parameters

xi : array-like, shape (n,)

1-d array containing values of the independent variable. Values must be real, finite and in strictly increasing order.

yi : array-like

Array containing values of the dependent variable. It can have arbitrary number of dimensions, but the length along axis (see below) must match the length of x . Values must be finite.

x : scalar or array-like, shape (m,)
axis : int, optional

Axis along which y is assumed to be varying. Meaning that for x[i] the corresponding values are np.take(y, i, axis=axis) . Default is 0.

bc_type : string or 2-tuple, optional

Boundary condition type. Two additional equations, given by the boundary conditions, are required to determine all coefficients of polynomials on each segment . If bc_type is a string, then the specified condition will be applied at both ends of a spline. Available conditions are: * 'not-a-knot' (default): The first and second segment at a curve end are the same polynomial. It is a good default when there is no information on boundary conditions. * 'periodic': The interpolated functions is assumed to be periodic of period x[-1] - x[0] . The first and last value of y must be identical: y[0] == y[-1] . This boundary condition will result in y'[0] == y'[-1] and y''[0] == y''[-1] . * 'clamped': The first derivative at curves ends are zero. Assuming a 1D y, bc_type=((1, 0.0), (1, 0.0)) is the same condition. * 'natural': The second derivative at curve ends are zero. Assuming a 1D y, bc_type=((2, 0.0), (2, 0.0)) is the same condition. If bc_type is a 2-tuple, the first and the second value will be applied at the curve start and end respectively. The tuple values can be one of the previously mentioned strings (except 'periodic') or a tuple :None:None:`(order, deriv_values)` allowing to specify arbitrary derivatives at curve ends: * :None:None:`order`: the derivative order, 1 or 2. * :None:None:`deriv_value`: array-like containing derivative values, shape must be the same as y, excluding axis dimension. For example, if y is 1D, then :None:None:`deriv_value` must be a scalar. If y is 3D with the shape (n0, n1, n2) and axis=2, then :None:None:`deriv_value` must be 2D and have the shape (n0, n1).

extrapolate : {bool, 'periodic', None}, optional

If bool, determines whether to extrapolate to out-of-bounds points based on first and last intervals, or to return NaNs. If 'periodic', periodic extrapolation is used. If None (default), extrapolate is set to 'periodic' for bc_type='periodic' and to True otherwise.

Returns

y : scalar or array-like

The result, of shape (m,)

Convenience function for cubic spline data interpolator.

See Also

scipy.interpolate.CubicHermiteSpline

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/missing.py#626
type: <class 'function'>
Commit: