correct indexing of DH share

This commit is contained in:
lisazeyen 2024-07-19 14:41:36 +02:00
parent 104fa73119
commit dea48c965a
2 changed files with 4 additions and 2 deletions

View File

@ -22,7 +22,7 @@ RS,25,5821
SI,8.86,1739
ES,0.251589260787732,1273
SE,50.4,
UK,2,
GB,2,
BY,70,
EE,52,5406
KO,3,207

1 country share to satisfy heat demand (residential) in percent capacity[MWth]
22 SI 8.86 1739
23 ES 0.251589260787732 1273
24 SE 50.4
25 UK GB 2
26 BY 70
27 EE 52 5406
28 KO 3 207

View File

@ -860,8 +860,10 @@ def build_district_heat_share(countries: List[str], idees: pd.DataFrame) -> pd.S
.squeeze()
)
# make conservative assumption and take minimum from both data sets
new_index = pd.MultiIndex.from_product([dh_share.index,
district_heat_share.index.get_level_values(1).unique()])
district_heat_share = pd.concat(
[district_heat_share, dh_share.reindex_like(district_heat_share)], axis=1
[district_heat_share, dh_share.reindex(new_index, level=0)], axis=1
).min(axis=1)
district_heat_share.name = "district heat share"