成功解决KeyError: “Passing list-likes to .loc or [] with any missing labels is no longer supported. The

ゝ一世哀愁。 2022-11-18 05:39 182阅读 0赞

成功解决KeyError: “Passing list-likes to .loc or [] with any missing labels is no longer supported. The following labels were missing: Index([‘Item_Identifier’], dtype=’object’). See https://pandas.pydata.org/pandas-docs/stable/user\_guide/indexing.html\#deprecate-loc-reindex-listlike“

目录

解决问题

解决思路

解决方法


解决问题

“Passing list-likes to .loc or [] with any missing labels “
KeyError: “Passing list-likes to .loc or [] with any missing labels is no longer supported. The following labels were missing: Index([‘Item_Identifier’], dtype=’object’). See https://pandas.pydata.org/pandas-docs/stable/user\_guide/indexing.html\#deprecate-loc-reindex-listlike“

解决思路

“将列表like传递给.loc或[],且没有任何标签”
KeyError: “不再支持将列表类型传递给.loc或[],且不支持任何缺失的标签。以下标签缺失:Index([‘Item_Identifier’], dtype=’object’)。
见https://pandas.pydata.org/pandas-docs/stable/user\_guide/indexing.html # deprecate-loc-reindex-listlike”

解决方法

在执行loc函数的时候,数据集中不存在指定的字段,请重新查看当前的字段是否被删除或者重命名,亦或者根本没有该字段!

发表评论

表情:
评论列表 (有 0 条评论,182人围观)

还没有评论,来说两句吧...

相关阅读