make sure not to divide by zero
This commit is contained in:
parent
028d0d6e7a
commit
39e853e2b3
@ -847,7 +847,7 @@ def build_district_heat_share(countries: List[str], idees: pd.DataFrame) -> pd.S
|
||||
)
|
||||
total_heat = idees[["thermal uses residential", "thermal uses services"]].sum(
|
||||
axis=1
|
||||
)
|
||||
).replace(0, np.nan)
|
||||
|
||||
district_heat_share = district_heat / total_heat
|
||||
|
||||
@ -866,6 +866,8 @@ def build_district_heat_share(countries: List[str], idees: pd.DataFrame) -> pd.S
|
||||
district_heat_share = pd.concat(
|
||||
[district_heat_share, dh_share.reindex(new_index, level=0)], axis=1
|
||||
).min(axis=1)
|
||||
|
||||
district_heat_share = district_heat_share.reindex(countries, level=0)
|
||||
|
||||
district_heat_share.name = "district heat share"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user