You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:\ProgramData\Anaconda3\lib\site-packages\pybacktest\performance.py in performance_summary(equity_diffs, quantile, precision)
89 if len(eqd) == 0:
90 return {}
---> 91 hold = holding_periods(equity_diffs)
92
93 return _format_out({
C:\ProgramData\Anaconda3\lib\site-packages\pybacktest\performance.py in holding_periods(eqd)
68 def holding_periods(eqd):
69 # rather crude, but will do
---> 70 return pd.Series(eqd.index.to_datetime(), index=eqd.index, dtype=object).diff().dropna()
71
72
AttributeError: 'DatetimeIndex' object has no attribute 'to_datetime'
The text was updated successfully, but these errors were encountered:
I am using Python 3.7 and Pandas 0.24
I get this error from holding_periods function.
Should it be?
Or it might be deprecated in latest versions of Pandas:
https://pandas.pydata.org/pandas-docs/version/0.21/generated/pandas.Timestamp.to_datetime.html
AttributeError Traceback (most recent call last)
in
----> 1 bt.summary()
C:\ProgramData\Anaconda3\lib\site-packages\pybacktest\backtest.py in summary(self)
172 print(s)
173 print(('-' * len(s) + '\n'))
--> 174 print((yaml.dump(self.report, allow_unicode=True, default_flow_style=False)))
175 print(('-' * len(s)))
176
C:\ProgramData\Anaconda3\lib\site-packages\cached_property.py in get(self, obj, cls)
33 return self._wrap_in_coroutine(obj)
34
---> 35 value = obj.dict[self.func.name] = self.func(obj)
36 return value
37
C:\ProgramData\Anaconda3\lib\site-packages\pybacktest\backtest.py in report(self)
162 @cached_property
163 def report(self):
--> 164 return pybacktest.performance.performance_summary(self.equity)
165
166 def summary(self):
C:\ProgramData\Anaconda3\lib\site-packages\pybacktest\performance.py in performance_summary(equity_diffs, quantile, precision)
89 if len(eqd) == 0:
90 return {}
---> 91 hold = holding_periods(equity_diffs)
92
93 return _format_out({
C:\ProgramData\Anaconda3\lib\site-packages\pybacktest\performance.py in holding_periods(eqd)
68 def holding_periods(eqd):
69 # rather crude, but will do
---> 70 return pd.Series(eqd.index.to_datetime(), index=eqd.index, dtype=object).diff().dropna()
71
72
AttributeError: 'DatetimeIndex' object has no attribute 'to_datetime'
The text was updated successfully, but these errors were encountered: