我正在使用tensorflow2.1设计一个股票预测程序。我的变量在我的程序结束时应该是一个二维变量,但只是一个一维。返回的错误是:predictions
Traceback (most recent call last):
File "/Users/owner/Desktop/algo/predict.py", line 120, in <module>
valid['Predictions'] = predictions
File "/usr/local/lib/python3.7/site-packages/pandas/core/frame.py", line 3487, in __setitem__
self._set_item(key, value)
File "/usr/local/lib/python3.7/site-packages/pandas/core/frame.py", line 3563, in _set_item
self._ensure_valid_index(value)
File "/usr/local/lib/python3.7/site-packages/pandas/core/frame.py", line 3540, in _ensure_valid_index
value = Series(value)
File "/usr/local/lib/python3.7/site-packages/pandas/core/series.py", line 314, in __init__
data = sanitize_array(data, index, dtype, copy, raise_cast_failure=True)
File "/usr/local/lib/python3.7/site-packages/pandas/core/internals/construction.py", line 729, in sanitize_array
raise Exception("Data must be 1-dimensional")
Exception: Data must be 1-dimensional
这个错误是由于Pandas,Numpy还是Tensorflow造成的?可以做些什么来满足这个错误陈述?我一直在GitHub上寻求帮助,但他们将我重定向到Stackoverflow。
慕田峪7331174
弑天下
相关分类