AI4Finance-Foundation / AI4Finance-Foundation/FinRL-Tutorials

Error when running "e_train_gym = StockTradingEnv(df = train, **env_kwargs)",AttributeError: 'numpy.float64' object has no attribute 'values'

Đang mở
#42 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Jupyter Notebook
Star
1.2k
Fork
435
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

File: Stock_NeurlPS2018_Train.ipynb

File ~/anaconda3/lib/python3.8/site-packages/finrl/meta/env_stock_trading/env_stocktrading.py:404, in StockTradingEnv._initiate_state(self)
398 if self.initial:
399 # For Initial State
400 if len(self.df.tic.unique()) > 1:
401 # for multiple stock
402 state = (
403 [self.initial_amount]
--> 404 + self.data.close.values.tolist()
405 + self.num_stock_shares
406 + sum(
407 (
408 self.data[tech].values.tolist()
409 for tech in self.tech_indicator_list
410 ),
411 [],
412 )
413 ) # append initial stocks_share to initial state, instead of all zero
414 else:
415 # for single stock
416 state = (
417 [self.initial_amount]
418 + [self.data.close]
419 + [0] * self.stock_dim
420 + sum(([self.data[tech]] for tech in self.tech_indicator_list), [])
421 )

AttributeError: 'numpy.float64' object has no attribute 'values'

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.