AI4Finance-Foundation / FinRL-Meta

FinRL­-Meta: Dynamic datasets and market environments for FinRL.
https://ai4finance.org
MIT License
1.28k stars 584 forks source link

AttributeError: 'DataFrame' object has no attribute 'date' #305

Open a18096 opened 1 year ago

a18096 commented 1 year ago

date = self.data.date.unique()[0]

File "E:\Projects\FinRL-Meta\meta\env_stock_trading\env_stocktrading_China_A_shares.py", line 451, in _get_date if len(self.df.tic.unique()) > 1: File "D:\Anaconda\envs\py38\lib\site-packages\pandas\core\generic.py", line 5575, in getattr return object.getattribute(self, name) AttributeError: 'DataFrame' object has no attribute 'date' 看调试数据, 只有这些列: ['tic', 'time', 'index', 'open', 'high', 'low', 'close', 'adjusted_close', 'volume', 'macd', 'boll_ub', 'boll_lb', 'rsi_30', 'cci_30', 'dx_30', 'close_30_sma', 'close_60_sma']

a18096 commented 1 year ago

Seems time and date messed in files, there is commit to change column name from date to time, but not complete. env_stocktrading_China_A_shares.py, tushare.py

It's better to change it by author to make sure completeness and correctness, Thanks!

leozhang9 commented 2 months ago

The same problems remain unresolved