From 366b8c285eaf019acecb61fe562cd5f20f6ab542 Mon Sep 17 00:00:00 2001 From: Kartik Subbarao Date: Tue, 6 Feb 2024 14:43:20 -0500 Subject: [PATCH] Update stats.py Fix FutureWarning with DataFrame.prod(), closes #8 --- quantstats_lumi/stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantstats_lumi/stats.py b/quantstats_lumi/stats.py index f44b164..a32c88c 100644 --- a/quantstats_lumi/stats.py +++ b/quantstats_lumi/stats.py @@ -102,7 +102,7 @@ def expected_return(returns, aggregate=None, compounded=True, prepare_returns=Tr if prepare_returns: returns = _utils._prepare_returns(returns) returns = _utils.aggregate_returns(returns, aggregate, compounded) - return _np.product(1 + returns) ** (1 / len(returns)) - 1 + return _np.product(1 + returns, axis=0) ** (1 / len(returns)) - 1 def geometric_mean(retruns, aggregate=None, compounded=True):