linopy.expressions.LinearExpression.groupby#
- LinearExpression.groupby(group, restore_coord_dims=None, **kwargs)#
Returns a LinearExpressionGroupBy object for performing grouped operations.
Docstring and arguments are borrowed from xarray.Dataset.groupby
- Parameters:
group (
str,DataArrayorIndexVariable) – Array whose unique values should be used to group this array. If a string, must be the name of a variable contained in this dataset.restore_coord_dims (
bool, optional) – If True, also restore the dimension order of multi-dimensional coordinates.
- Returns:
grouped– A LinearExpressionGroupBy containing the xarray groups and ensuring the correct return type.