成功解决sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is amb
成功解決sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is amb
?
?
?
?
?
?
目錄
解決問題
解決思路
解決方法
?
?
?
?
?
?
?
?
解決問題
F:\Program Files\Python\Python36\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
? if diff:
?
?
?
?
解決思路
錯誤地址:F:\Program Files\Python\Python36\lib\site-packages\sklearn\preprocessing\label.py:151
丟棄警告:空數(shù)組的真值不明確。返回false,但在將來這將導(dǎo)致錯誤。使用“array.size>0”檢查數(shù)組是否為空。
?
?
?
?
解決方法
該問題是警告信息,不處理亦可運行程序,只需理解一下即可!空數(shù)組的真值不明確。返回false,但在將來這將導(dǎo)致錯誤。該庫未來的升級ban版本中,需要采用“array.size>0”檢查數(shù)組是否為空。
?
?
?
?
?
?
?
?
總結(jié)
以上是生活随笔為你收集整理的成功解决sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is amb的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ML之xgboost:利用xgboost
- 下一篇: ML之xgboost:利用xgboost