pandas错误之: in pandas._libs.hashtable.PyObjectHashTable.get_item

目的:取data的第41行第6个数据
运行data[40][5]返回一下错误:
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
原因是我的索引用错了
data[40][5]的意思是取第41列第6个数据,而我的数据中并没有41列,正确的应该是:
data.loc[40][5]

猜你喜欢

转载自blog.csdn.net/wyll19980812/article/details/107755105
今日推荐