PyPSA / linopy

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

expression: support Expression init with constant values (pandas, numpy, scalar) #242

Closed FabianHofmann closed 4 months ago

FabianHofmann commented 4 months ago

It is now possible to create LinearExpression from a pandas.DataFrame, pandas.Series, a numpy.array or constant scalar values, e.g. linopy.LinearExpression(df). This will create a LinearExpression with constants only and the coordinates of the DataFrame, Series or array as dimensions.