get_x_value_interp

get_x_value_interp(x: Any, y: Any, y_target: float) float | None[source]

Find the x-value corresponding to a target y-value using interpolation.

Useful for finding thresholds (e.g., x value where y crosses 50%).

Parameters:
  • x (Any) – Input x coordinates.

  • y (Any) – Input y coordinates.

  • y_target (float) – The target y value to search for.

Returns:

The estimated x value, or None if the target is out of range or interpolation fails.

Return type:

float | None