Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions pandas/core/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@
)

if TYPE_CHECKING:
from typing import TypeAlias

from pandas import Index

_CubicBC: TypeAlias = Literal["not-a-knot", "clamped", "natural", "periodic"]


def check_value_size(value, mask: npt.NDArray[np.bool_], length: int):
"""
Expand Down Expand Up @@ -652,7 +656,7 @@ def _akima_interpolate(
xi: np.ndarray,
yi: np.ndarray,
x: np.ndarray,
der: int | list[int] | None = 0,
der: int = 0,
axis: AxisInt = 0,
):
"""
Expand All @@ -673,10 +677,8 @@ def _akima_interpolate(
x : np.ndarray
Of length M.
der : int, optional
How many derivatives to extract; None for all potentially
nonzero derivatives (that is a number equal to the number
of points), or a list of derivatives to extract. This number
includes the function value as 0th derivative.
How many derivatives to extract. This number includes the function
value as 0th derivative.
axis : int, optional
Axis in the yi array corresponding to the x-coordinate values.

Expand All @@ -702,9 +704,9 @@ def _cubicspline_interpolate(
yi: np.ndarray,
x: np.ndarray,
axis: AxisInt = 0,
bc_type: str | tuple[Any, Any] = "not-a-knot",
extrapolate=None,
):
bc_type: _CubicBC | tuple[Any, Any] = "not-a-knot",
extrapolate: Literal["periodic"] | bool | None = None,
) -> np.ndarray:
"""
Convenience function for cubic spline data interpolator.

Expand Down
Loading