File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,11 @@ def _as_list(value):
26
26
27
27
def _data_period (df ):
28
28
"""Return data index period as pd.Timedelta"""
29
- return df .index [:100 ].to_series (keep_tz = True ).diff ().median ()
29
+ if df .index .is_all_dates :
30
+ values = df .index [:100 ].to_series (keep_tz = True )
31
+ else :
32
+ values = df .index [:100 ].to_series ()
33
+ return values .diff ().median ()
30
34
31
35
32
36
class _Array (np .ndarray ):
Original file line number Diff line number Diff line change @@ -870,8 +870,7 @@ def _drawdown_duration_peaks(dd, index):
870
870
df ['Drawdown Duration' ] = dd_dur
871
871
dd_dur = df ['Drawdown Duration' ]
872
872
873
- # Strip timezone info, otherwise pandas 0.24.2 errors when filling `s` ahead
874
- df .index = data .index .tz_convert (None )
873
+ df .index = data .index
875
874
876
875
def _round_timedelta (value , _period = _data_period (df )):
877
876
if not isinstance (value , pd .Timedelta ):
You can’t perform that action at this time.
0 commit comments