Feature/scenarios dims order#219
Merged
FBumann merged 11 commits intofeature/scenariosfrom Apr 5, 2025
Merged
Conversation
# Conflicts: # flixopt/results.py
Member
Author
Change the order of dimensions
Furthermore, converting a solution to a Dataframe with
In[4]:
calculation.results.solution['CHP(Q_th)|flow_rate'].to_pandas()
Out[4]:
scenario Base Case High Demand
time
2020-01-01 00:00:00 25.000000 25.000000
2020-01-01 01:00:00 21.666667 21.666667
2020-01-01 02:00:00 75.000000 75.000000
2020-01-01 03:00:00 75.000000 75.000000
2020-01-01 04:00:00 75.000000 75.000000
2020-01-01 05:00:00 15.000000 15.000000
2020-01-01 06:00:00 15.000000 15.000000
2020-01-01 07:00:00 15.000000 15.000000
2020-01-01 08:00:00 15.000000 15.000000
2020-01-01 09:00:00 NaN NaNWhen initiating data from numpy, this needs to be done as follows:For Data for each timestep and scenario, a 2D array is needed. But : heat_demand_per_h = array([
[ 30, 30],
[ 0, 0],
[ 90, 100],
[110, 118],
[110, 125],
[ 20, 20],
[ 20, 20],
[ 20, 20],
[ 20, 20]
])
# Or for convenience:
heat_demand_per_h = np.array([[30, 0, 90, 110, 110, 20, 20, 20, 20],
[30, 0, 100, 118, 125, 20, 20, 20, 20]]).TFor Data for each timestep, a 1D array is enough: heat_demand_per_h = np.array([30, 0, 90, 110, 110, 20, 20, 20, 20])As for data per scenario heat_demand_per_h = np.array([20, 30]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.