PyPSA / linopy

Linear optimization with N-D labeled arrays in Python
https://linopy.readthedocs.io
MIT License
154 stars 42 forks source link

expression: ensure alignment with pandas dataframes and xarray dataarrays #243

Closed FabianHofmann closed 4 months ago

FabianHofmann commented 4 months ago

When grouping an expression or a variable by a pandas.DataFrame or a xarray.DataArray, the coordinates of the groupby object were not properly aligned. So in cases, when the groupby object was not indexed in the same way as the variable/expression, the groupby operation led to wrong results. This is fixed now.