Closed lcavalie closed 1 year ago
Hi.
!pip install git+https://github.com/lcavalie/FinRL.git
Can you solve the [AttributeError: 'Timedelta' object has no attribute 'delta'] problem reported by colab?
Thanks!
Yes,
it's common issue if you are running a recent version of Panda where Timedelta does not have a .delta attribute anymore.
The purpose of my code is to solve issue 981 which is about filling the dataframe with stock prices at zero caused to the error in timezones between daylight saving time or not daylight saving time.
To fix the panda 'object has no attribute' error you need to change the line from:
if pd.Timedelta(time_interval).delta < day_delta:
to
if pd.Timedelta(time_interval).total_seconds() < 27000:
as there are 27,000 second during which the market is open.
L
@lcavalie thanks for your codes.
Fix for time zone conversion error Fix issue 981