interpolate

interpolate(x: Any, y: Any, points: int = 100) tuple[numpy.ndarray, numpy.ndarray][source]

Perform PCHIP interpolation on specific data points.

Sorts the data, averages y-values for duplicate x-values, and generates interpolated points.

Parameters:
  • x (Any) – Input x coordinates (array-like).

  • y (Any) – Input y coordinates (array-like).

  • points (int, optional) – Number of interpolated points to generate. Default: 100.

Returns:

A tuple (x_fit, y_fit) of interpolated arrays, or (None, None) if insufficient data points.

Return type:

tuple[np.ndarray, np.ndarray]