overwriting agriculture and transport totals

This commit is contained in:
toniseibold 2024-03-25 15:03:23 +01:00
parent d72576aa1a
commit e8761c9e24

View File

@ -842,7 +842,7 @@ def rescale_idees_from_eurostat(
"total": [
"total agriculture heat",
"total agriculture machinery",
"total agriculture",
"total agriculture", # = sum of all other agriculture categories
],
"elec": [
"total agriculture electricity",
@ -850,7 +850,7 @@ def rescale_idees_from_eurostat(
},
"Road": {
"total": [
"total road",
"total road", # = sum of all other road categories
"total passenger cars",
"total other road passenger",
"total light duty road freight",
@ -891,6 +891,7 @@ def rescale_idees_from_eurostat(
navigation = [
"total domestic navigation",
]
# international navigation is already read in from the eurostat data directly
for country in idees_countries:
filling_years = [(2015, slice(2016, 2021)), (2000, slice(1990, 1999))]
@ -940,6 +941,17 @@ def rescale_idees_from_eurostat(
energy.loc[slicer_source, navigation].squeeze(axis=0),
).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, ["total agriculture electricity", "total agriculture heat", "total agriculture machinery"]].sum(axis=1)
energy.loc[country, :]["total road"] = energy[["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"]].loc[country, :].sum(axis=1)
return energy