Skip to content

Commit

Permalink
Adjust compound_growth for pandas 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Aug 31, 2023
1 parent 2056fd4 commit 877dbc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion message_ix_models/report/computations.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def compound_growth(qty: Quantity, dim: str) -> Quantity:
# Compute intervals along `dim`
# The value at index d is the duration between d and the next index d+1
c = qty.coords[dim]
dur = (c - c.shift({dim: 1})).fillna(0).shift({dim: -1})
dur = (c - c.shift({dim: 1})).fillna(0).shift({dim: -1}).fillna(0)
# - Raise the values of `qty` to the power of the duration.
# - Compute cumulative product along `dim` from the first index.
# - Shift, so the value at index d is the growth relative to the prior index d-1
Expand Down

0 comments on commit 877dbc1

Please sign in to comment.