PyPSA / linopy

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

Improved pandas object alignment #239

Closed FabianHofmann closed 7 months ago

FabianHofmann commented 7 months ago

Changes:

The handling of pandas objects was improved. As pandas objects are fully aware of coordinates, their index and columns are now strictly taken into account. For example, when multiplying a pandas.DataFrame with a variable, linopy now checks the alignment of indexes and reindexes accordingly. Previously, if the axis shapes were the same, the indexes of the variable were inserted and the pandas indexes were effectively ignored. A warning has been added for cases where users should expect changes to the results with this version. Important: This does not apply to overwriting the coordinates when one expression is added to another, e.g. "x + df" still overwrites the index of "df" when the dimensional shapes are aligned.