We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4cc092 commit 421d80dCopy full SHA for 421d80d
okama/common/helpers/helpers.py
@@ -224,9 +224,9 @@ def get_annual_return_ts_from_monthly(
224
"""
225
Annual Rate of Returns time series from monthly data.
226
227
- if return_type == "cagr":
+ if return_type.lower() == "cagr":
228
ts = ror_monthly.resample("A").apply(lambda x: np.prod(x + 1.0) - 1)
229
- elif return_type == "arithmetic_mean":
+ elif return_type.lower() == "arithmetic_mean":
230
ts = ror_monthly.resample("A").sum()
231
else:
232
raise ValueError("Return type must be either cagr or arithmetic_mean.")
0 commit comments