Apply a scikit-learn transformer across a dimension of an xarray DataArray.
Helper function in order to use scikit-learn functions with the xarray target.
- Parameters:
data (DataArray) – The input data to transform.
func (Callable[[ndarray], ndarray]) – scikit-learn method to apply to the data
dim_name (str) – Name of the dimension to apply the function to
- Return type:
xr.DataArray