Skip to content

Commit

Permalink
build_biomass_potentials: fix groupby and transpose
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianHofmann committed Dec 18, 2023
1 parent cc08dff commit d39b579
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/build_biomass_potentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def convert_nuts2_to_regions(bio_nuts2, regions):
df.to_csv(snakemake.output.biomass_potentials_all)

grouper = {v: k for k, vv in params["classes"].items() for v in vv}
df = df.T.groupby(grouper).sum()
df = df.T.groupby(grouper).sum().T

df *= 1e6 # TWh/a to MWh/a
df.index.name = "MWh/a"
Expand Down

0 comments on commit d39b579

Please sign in to comment.