Skip to content

Commit 30904bb

Browse files
author
Ildhesten
committed
get_max_drawdown_underwater, now uses idxmin rather than np.argmin to get the label of the minimum element in the time series rather than the index.
1 parent e915edf commit 30904bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyfolio/timeseries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ def get_max_drawdown_underwater(underwater):
890890
The maximum drawdown's recovery.
891891
"""
892892

893-
valley = np.argmin(underwater) # end of the period
893+
valley = underwater.idxmin() # end of the period
894894
# Find first 0
895895
peak = underwater[:valley][underwater[:valley] == 0].index[-1]
896896
# Find last 0

0 commit comments

Comments
 (0)