Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
a18096 opened this issue Jul 22, 2023 · 2 comments
Open

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

a18096 opened this issue Jul 22, 2023 · 2 comments
Assignees
Labels
discussion Code understanding good first issue Good for newcomers

Comments

@a18096
Copy link

a18096 commented Jul 22, 2023

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
Copy link
Author

a18096 commented Jul 23, 2023

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!

@YangletLiu YangletLiu added good first issue Good for newcomers discussion Code understanding labels Jul 29, 2023
@leozhang9
Copy link

The same problems remain unresolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Code understanding good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants