Skip to content

Conversation

@jpaduart
Copy link
Collaborator

Warning: I removed the df.squeeze() at the end of the netting, because it's an unsafe operation on dataframes:
df.squeeze() gives inconsistent results according to the number of columns in a dataframe. The structure of the columns becomes different if (by coincidence) only a single psr_type (in case of aggregated generation) or a single plant unit (in case of unit generation) is present in the queried data.
A specific column level can be removed with the following operation (=safer than squeeze):
df = df.droplevel(1, level_index)
(removing level_index of the multiindex column axis).

jpaduart added 3 commits July 14, 2021 21:12
- Pass on nett argument to query_generation_per_plant
- Refactor and generalize _calc_nett_and_drop_reduntant_columns to cope
with 3 column levels (unit/psr_type/aggregation)
- Warning: this removes df.squeeze() at the end of the netting.
df.squeeze() gives inconsistent results according to the number of
columns in a dataframe (structure is different if by coincidence only
one technology or plant unit is present in the data).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant