linopy.variables.Variable.sum#
- Variable.sum(dim=None, **kwargs)#
Sum the variables over all or a subset of dimensions.
This stack all terms of the dimensions, that are summed over, together. The function works exactly in the same way as
LinearExpression.sum().- Parameters:
dim (
str/list, optional) – Dimension(s) to sum over. The default is None which results in all dimensions.dims (
str/list, optional) – Deprecated. Usediminstead.
- Returns:
linopy.LinearExpression– Summed expression.