From 7ad60cb7f985dee07c515d0b795eebbc9660ecc1 Mon Sep 17 00:00:00 2001 From: ekatef Date: Wed, 11 Oct 2023 12:28:34 +0300 Subject: [PATCH] Fix calculation of averages --- scripts/build_retro_cost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_retro_cost.py b/scripts/build_retro_cost.py index b65c82ba..04ae6ef4 100644 --- a/scripts/build_retro_cost.py +++ b/scripts/build_retro_cost.py @@ -987,7 +987,7 @@ def sample_dE_costs_area( # drop not considered countries cost_dE = cost_dE.reindex(countries, level=0) # get share of residential and service floor area - sec_w = area_tot.value / area_tot.value.groupby(level=0).sum() + sec_w = area_tot.div(area_tot.groupby(level=0).transform('sum')) # get the total cost-energy-savings weight by sector area tot = ( cost_dE.mul(sec_w, axis=0)