Skip to content

Commit

Permalink
fix: fill NaN values from divison by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Sep 6, 2024
1 parent 920b420 commit 8787e61
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def fetch_sales(self):

# NOTE: rate must be calculated after summing up the rows
rows_df["rate"] = rows_df["amount"] / rows_df["net_billed"]
# when net_billed is 0, rate is NaN
rows_df["rate"].fillna(0, inplace=True)

self.sales = []
self.extend("sales", rows_df.to_dict(orient="records"))
Expand Down

0 comments on commit 8787e61

Please sign in to comment.