Fill in missing eurostat data on domestic aviation energy demand
This commit is contained in:
parent
09d5ce2512
commit
a8454fd830
@ -124,6 +124,17 @@ def build_eurostat(input_eurostat, countries, nprocesses=1, disable_progressbar=
|
||||
)
|
||||
df = pd.concat([temp, df.loc[~int_avia]])
|
||||
|
||||
# Fill in missing data on "Domestic aviation" for each country.
|
||||
domestic_avia = df.index.get_level_values(4) == "Domestic aviation"
|
||||
for country in countries:
|
||||
slicer = idx[country, :, :, :, "Domestic aviation"]
|
||||
# For the Total and Fossil energy columns, fill in zeros with
|
||||
# the closest non-zero value in the year index.
|
||||
for col in ["Total", "Fossil energy"]:
|
||||
df.loc[slicer, col] = (
|
||||
df.loc[slicer, col].replace(0.0, np.nan).ffill().bfill()
|
||||
)
|
||||
|
||||
# Renaming some indices
|
||||
index_rename = {
|
||||
"Households": "Residential",
|
||||
|
Loading…
Reference in New Issue
Block a user