From 9c57cc5f5b2c47a0e6ed5092b7f995c0e5f422d0 Mon Sep 17 00:00:00 2001 From: Ryan Foster Date: Fri, 12 Mar 2021 18:32:50 -0800 Subject: [PATCH] fix for #652 get_max_drawdown_underwater :wrench: --- pyfolio/timeseries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfolio/timeseries.py b/pyfolio/timeseries.py index 2b34d3b7..c99f1725 100644 --- a/pyfolio/timeseries.py +++ b/pyfolio/timeseries.py @@ -890,7 +890,7 @@ def get_max_drawdown_underwater(underwater): The maximum drawdown's recovery. """ - valley = underwater.idxmin() # end of the period + valley = underwater.index[underwater.values.argmin()] # end of the period # Find first 0 peak = underwater[:valley][underwater[:valley] == 0].index[-1] # Find last 0