diff --git a/pandas/core/missing.py b/pandas/core/missing.py index b443b22201e37..ff6dc5ad29fd2 100644 --- a/pandas/core/missing.py +++ b/pandas/core/missing.py @@ -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): """ @@ -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, ): """ @@ -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. @@ -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.