在TA-Lib库中放置一些数据帧时出现一些错误,不知道下一步该怎么做



我在ta库中放入了一些数据帧来检测吞噬模式,但出现了这个错误,我不知道这意味着什么,请帮助

import pandas as pd
import talib as tb
bnkin = pd.read_csv("BANKINDIA.csv")
print(bnkin)
integer = tb.CDLENGULFING(bnkin['open'], bnkin['high'], bnkin['low'], bnkin['close'])
print(integer)
Traceback (most recent call last):
File "C:UsersmyadsAppDataLocalProgramsPythonPython38-32libsite-packagespandascoreindexesbase.py", line 3081, in get_loc   
return self._engine.get_loc(casted_key)
File "pandas_libsindex.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libsindex.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libshashtable_class_helper.pxi", line 4554, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libshashtable_class_helper.pxi", line 4562, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'open'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:/Users/myads/OneDrive/Desktop/technical_analysis/TAprg.py", line 29, in <module>
integer = tb.CDLENGULFING(bnkin['open'], bnkin['high'], bnkin['low'], bnkin['close'])
File "C:UsersmyadsAppDataLocalProgramsPythonPython38-32libsite-packagespandascoreframe.py", line 3024, in __getitem__      
indexer = self.columns.get_loc(key)
File "C:UsersmyadsAppDataLocalProgramsPythonPython38-32libsite-packagespandascoreindexesbase.py", line 3083, in get_loc
raise KeyError(key) from err
KeyError: 'open'

孟加拉国.csv:-

您正在查找一个"open"列,但csv有一个"open"列,因此出现键错误。

相关内容

最新更新