From e4eb79ab8e37b0fc7b3f80b319e1e7bc39de5c9b Mon Sep 17 00:00:00 2001 From: Donggeon Lee Date: Sun, 9 Feb 2020 17:26:03 +0900 Subject: [PATCH] fix ValueError : No axis named 1 for object type --- performanceanalytics/table/table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/performanceanalytics/table/table.py b/performanceanalytics/table/table.py index 584bd84..54c304e 100644 --- a/performanceanalytics/table/table.py +++ b/performanceanalytics/table/table.py @@ -65,7 +65,7 @@ def calendar_returns(data_series, manager_col=0, index_cols=None, as_perc=False) idx = '-'.join([str(y), str(m)]) # see if the index is in there if idx in _s.index: - df.iloc[mc][y] = _s[idx] + df.iloc[mc][y] = np.prod(1+_s[idx].dropna()) - 1 # we now have the data frame, now we can append the annual returns as the last row annual_returns = []