AI4Finance-Foundation / FinRL-Tutorials

Tutorials. Please star.
https://ai4finance.org
MIT License
848 stars 349 forks source link

Fixing tuple, 'UTC has no key' errors and update alpaca_history to comply with the latest version of pandas in FinRL_PaperTrading_Demo.ipynb #82

Closed kurone02 closed 8 months ago

kurone02 commented 8 months ago

An updated version of the gymnasium package changes the behavior of gymnasium.Env.reset. The return value of the reset method now returns a tuple of observation and info, which causes the tuple error mentioned in #78. Please refer to the gymasium's documentation for more details. This is fixed by ignoring the second value in the returned tuple.

The current version of the exchange-calendars package requires the dates to be timezone native, which causes the "UTC has no key" error mentioned in #81. This was resolved by erasing tz=pytz.UTC.

Also, the current version of pandas has deprecated DataFrame.append. For more details, please refer to the pandas' documentation. This is solved by simply changing the code from df.append to pd.concat in the alpaca_history function.

zhumingpassional commented 8 months ago

thanks for your codes.