find_closest_leftnright_elements
- breads.utils.find_closest_leftnright_elements(v1, v2)[source]
Find the closest elements in v1 to the left and right of each element in v2. (By chatgpt)
- Parameters:
- v1np.ndarray
The array to search within (may contain NaNs).
- v2np.ndarray
The array with values to find bounds for (may contain NaNs).
- Returns:
- v_leftnp.ndarray
Closest elements in v1 to the left of each element in v2.
- v_right: np.ndarray
Closest elements in v1 to the right of each element in v2.