KeyError:“功能”

时间:2019-02-26 08:42:56

标签: python pandas dataframe keyword

我试图训练模型,但是出现以下错误。有人可以帮我确定为什么会出现此错误以及如何解决此错误吗? 以下是代码的一部分::

with gzip.open('mfcc_feat.pkl', 'rb') as ifp:
file = pickle.load(ifp)
print(file.head())
df = pd.read_csv('C:\\Downloads\\emotion_values.csv')
file = file.merge(df, on='Name', how='outer')
print(file.head())
print(file['features'][10].shape)

我遇到的错误是::

print(file['features'][10].shape)
pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'features'

0 个答案:

没有答案