mirror of
https://github.com/kernc/backtesting.py.git
synced 2024-01-28 15:29:30 +03:00
REF: Drop timezone in stats computation for pandas 0.24.2
This commit is contained in:
@@ -865,7 +865,8 @@ class Backtest:
|
||||
df['Drawdown Duration'] = dd_dur
|
||||
dd_dur = df['Drawdown Duration']
|
||||
|
||||
df.index = data.index
|
||||
# Strip timezone info, otherwise pandas 0.24.2 errors when filling `s` ahead
|
||||
df.index = data.index.tz_convert(None)
|
||||
|
||||
def _round_timedelta(value, _period=_data_period(df)):
|
||||
return value.ceil(_period.resolution) if isinstance(value, pd.Timedelta) else value
|
||||
|
||||
Reference in New Issue
Block a user