Skip to content

Commit

Permalink
bugfix: ensure separately calculated sums are entered (follow-up to P…
Browse files Browse the repository at this point in the history
  • Loading branch information
fneum committed May 25, 2024
1 parent fd9e93b commit a60e6fc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/build_energy_totals.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,20 +940,21 @@ def rescale_idees_from_eurostat(
).values

# set the total of agriculture/road to the sum of all agriculture/road categories (corresponding to the IDEES data)
sel = [
rows = idx[country, :]
cols = [
"total agriculture electricity",
"total agriculture heat",
"total agriculture machinery",
]
energy.loc[country, "total agriculture"] = energy.loc[country, sel].sum(axis=1)
energy.loc[rows, "total agriculture"] = energy.loc[rows, cols].sum(axis=1)

sel = [
cols = [
"total passenger cars",
"total other road passenger",
"total light duty road freight",
"total heavy duty road freight",
]
energy.loc[country, "total road"] = energy.loc[country, sel].sum(axis=1)
energy.loc[rows, "total road"] = energy.loc[rows, cols].sum(axis=1)

return energy

Expand Down

0 comments on commit a60e6fc

Please sign in to comment.