Skip to content

Commit

Permalink
Supply chain: prevent warnings from dtype incompatibilities (#115)
Browse files Browse the repository at this point in the history
Pandas now throws warnings when you try to combine different data
types rather than coercing the data. The supplychain module fills
an empty data frame with '0' and adds calculated values into the
frame. This update fills the frame with '0.0' so that the dtypes
match and pandas will shut up.

Co-authored-by: emanuel-schmid <[email protected]>
  • Loading branch information
ChrisFairless and emanuel-schmid authored Sep 9, 2024
1 parent d587dbd commit 7595f99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions climada_petals/engine/supplychain.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,12 +566,12 @@ def calc_shock_to_sectors(self,
self.events_date = impact.date[events_w_imp_bool]

self.secs_exp = pd.DataFrame(
0,
0.0,
index=["total_value"],
columns=self.mriot.Z.columns
)
self.secs_imp = pd.DataFrame(
0,
0.0,
index=impact.event_id[events_w_imp_bool],
columns=self.mriot.Z.columns
)
Expand Down

0 comments on commit 7595f99

Please sign in to comment.