成功解决KeyError: “Passing list-likes to .loc or [] with any missing labels is no longer supported. The
成功解決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函數的時候,數據集中不存在指定的字段,請重新查看當前的字段是否被刪除或者重命名,亦或者根本沒有該字段!
?
總結
以上是生活随笔為你收集整理的成功解决KeyError: “Passing list-likes to .loc or [] with any missing labels is no longer supported. The的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Graphviz:利用可视化工具Grap
- 下一篇: ML之FE:基于BigMartSales