bugfix: include total heavy-duty road freight; do not treat total transport as other but including electricity

This commit is contained in:
Fabian Neumann 2024-05-20 15:37:54 +02:00
parent d09df8a473
commit f25c594a07

View File

@ -842,7 +842,7 @@ def rescale_idees_from_eurostat(
"total": [
"total agriculture heat",
"total agriculture machinery",
"total agriculture", # = sum of all other agriculture categories
"total agriculture",
],
"elec": [
"total agriculture electricity",
@ -850,10 +850,11 @@ def rescale_idees_from_eurostat(
},
"Road": {
"total": [
"total road", # = sum of all other road categories
"total road",
"total passenger cars",
"total other road passenger",
"total light duty road freight",
"total heavy duty road freight",
],
"elec": [
"electricity road",
@ -942,30 +943,20 @@ 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)
energy.loc[country, "total agriculture"] = energy.loc[
country,
[
sel = [
"total agriculture electricity",
"total agriculture heat",
"total agriculture machinery",
],
].sum(axis=1)
]
energy.loc[country, "total agriculture"] = energy.loc[country, sel].sum(axis=1)
energy.loc[country, "total road"] = (
energy[
[
sel = [
"total passenger cars",
"total other road passenger",
"total light duty road freight",
"electricity road",
"electricity passenger cars",
"electricity other road passenger",
"electricity light duty road freight",
"total heavy duty road freight",
]
]
.loc[country, :]
.sum(axis=1)
)
energy.loc[country, "total road"] = energy.loc[country, sel].sum(axis=1)
return energy