我确实遇到了一个按键错误,以前从未见过这种情况。有人能帮我解决这个问题吗?提前非常感谢
输出:
File "/home/maurits/freqtrade/user_data/hyperopts/BBRSI_hyperopts.py", line 55, in populate_indicators
dataframe["bb_middleband1"] = bollinger1["middle"]
File "/home/maurits/freqtrade/.env/lib/python3.8/site-packages/pandas/core/frame.py", line 2800, in __getitem__
indexer = self.columns.get_loc(key)
File "/home/maurits/freqtrade/.env/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 2648, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'middle'
答案在错误消息中。它是这样说的:
代码中的某个地方有一行:
这一行的作用是将名为“middle”的列中名为bollinger1的数据框内的值分配给名为“bb_middleband1”的数据框内名为“bb_middleband1”的另一列
这是绝对合法的代码。问题是在数据帧bollinger1中没有名为“middle”的列。现在,您的任务是调试它并找出为什么没有这样的专栏。无法帮助您,因为您的项目没有源代码
我认为这个错误一定是因为没有名为“middle”的列。 将名称从“中间”更改为“中间”
这是我的密码
相关问题 更多 >
编程相关推荐