mirror of
https://github.com/kernc/backtesting.py.git
synced 2024-01-28 15:29:30 +03:00
MNT: Adapt for pandas 1.0.0 (bug workaround + two depr warnings)
This commit is contained in:
@@ -33,10 +33,7 @@ def _as_list(value):
|
||||
|
||||
def _data_period(df):
|
||||
"""Return data index period as pd.Timedelta"""
|
||||
if df.index.is_all_dates:
|
||||
values = df.index[:100].to_series(keep_tz=True)
|
||||
else:
|
||||
values = df.index[:100].to_series()
|
||||
values = df.index[-100:].to_series()
|
||||
return values.diff().median()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user