AI4Finance-Foundation / AI4Finance-Foundation/FinRL_Podracer

ValueError: arrays must be the same length

オープン
#6 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
507
フォーク
121
PR マージ指標
30日以内にマージされた PR はありません

説明

I'm running the demo notebook unmodified on Ubuntu 20.04 machine with one GPU, everything is pip installed properly, but I keep getting this error below no matter what I do. It works in Colab but not locally. Why? How can I fix this?

| load data: .//StockTradingEnv_trading_data.df
| YahooDownloader: finish processing date list
| GPU id: 0, cwd: ./AgentPPO/StockTradingEnv-v2_0
Loaded act: ./AgentPPO/StockTradingEnv-v2_0
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in
6 args.init_before_training()
7
----> 8 prediction = args.env.trade_prediction(args, torch)

~/Dropbox/Code/work/stocks_boredhumans/Elegant-FinRL/elegant_finrl/env.py in trade_prediction(self, args, _torch)
266 # print(len(self.date_list))
267 # print(self.date_list)
--> 268 df_account_value = pd.DataFrame({'date':self.date_list,'account_value':episode_returns})
269 return df_account_value
270

/usr/local/lib/python3.8/dist-packages/pandas/core/frame.py in __init__(self, data, index, columns, dtype, copy)
527
528 elif isinstance(data, dict):
--> 529 mgr = init_dict(data, index, columns, dtype=dtype)
530 elif isinstance(data, ma.MaskedArray):
531 import numpy.ma.mrecords as mrecords

/usr/local/lib/python3.8/dist-packages/pandas/core/internals/construction.py in init_dict(data, index, columns, dtype)
285 arr if not is_datetime64tz_dtype(arr) else arr.copy() for arr in arrays
286 ]
--> 287 return arrays_to_mgr(arrays, data_names, index, columns, dtype=dtype)
288
289

/usr/local/lib/python3.8/dist-packages/pandas/core/internals/construction.py in arrays_to_mgr(arrays, arr_names, index, columns, dtype, verify_integrity)
78 # figure out the index, if necessary
79 if index is None:
---> 80 index = extract_index(arrays)
81 else:
82 index = ensure_index(index)

/usr/local/lib/python3.8/dist-packages/pandas/core/internals/construction.py in extract_index(data)
399 lengths = list(set(raw_lengths))
400 if len(lengths) > 1:
--> 401 raise ValueError("arrays must all be same length")
402
403 if have_dicts:

ValueError: arrays must all be same length

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。