Broken jupyter notebook examples - #2
serendipitouscoder
started this conversation in
General
Replies: 1 comment
-
Hello @serendipitouscoder, It is because of pandas new release |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I am trying to run the example notebook on the google colab.
The following line of code in the notebook "FinRL_PaperTrading_Demo.ipynb" is broken -
data = DP.download_data(start_date = '2021-10-04',
end_date = '2021-10-08',
ticker_list = ticker_list,
time_interval= '1Min')
It produced the following error:
AttributeError Traceback (most recent call last)
Cell In[22], line 1
----> 1 data = DP.download_data(start_date = '2021-10-04',
2 end_date = '2021-10-08',
3 ticker_list = ticker_list,
4 time_interval= '1Min')
File /usr/local/lib/python3.10/site-packages/finrl/meta/data_processor.py:37, in DataProcessor.download_data(self, ticker_list, start_date, end_date, time_interval)
34 def download_data(
35 self, ticker_list, start_date, end_date, time_interval
36 ) -> pd.DataFrame:
---> 37 df = self.processor.download_data(
38 ticker_list=ticker_list,
39 start_date=start_date,
40 end_date=end_date,
41 time_interval=time_interval,
42 )
43 return df
File /usr/local/lib/python3.10/site-packages/finrl/meta/data_processors/processor_alpaca.py:52, in AlpacaProcessor.download_data(self, ticker_list, start_date, end_date, time_interval)
49 # from trepan.api import debug;debug()
50 # filter opening time of the New York Stock Exchange (NYSE) (from 9:30 am to 4:00 pm) if time_interval < 1D
51 day_delta = 86400000000000 # pd.Timedelta('1D').delta == 86400000000000
---> 52 if pd.Timedelta(time_interval).delta < day_delta:
53 NYSE_open_hour = "14:30" # in UTC
54 NYSE_close_hour = "20:59" # in UTC
AttributeError: 'Timedelta' object has no attribute 'delta'
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I think this is due to a library version incompatibility. It is in the alpaca library. I should be able to fix it locally on my own installation but I think it would be best if it was fixed on your current development branch.
Any advice would be appreciated.
Many thanks.
Wazed
Beta Was this translation helpful? Give feedback.
All reactions