成功解决FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `ar
成功解決FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `ar
?
?
?
目錄
解決問題
解決思路
解決方法
?
?
?
?
解決問題
stats.py:1633: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
? return np.add.reduce(sorted[indexer] * weights, axis=axis) / sumval
?
?
?
?
解決思路
未來的警告:不建議使用非元組序列進行多維索引;使用“arr[tuple(seq)]”而不是“arr[seq]”。將來,這將被解釋為一個數組索引' arr[np.array(seq)] ',它將導致錯誤或不同的結果。
? return np.add.reduce(sorted[indexer] * weights, axis=axis) / sumval
?
?
?
?
解決方法
此信息提示為警告,而不是error,即使不處理也不會影響代碼編程的運行。如果想要去掉,可以更新庫至最新版本!
然后根據提示修改使用方法!
如果想要去掉,可以根據提示采用改進的方法!
將arr[seq]改為arr[tuple(seq)]即可!
總結
以上是生活随笔為你收集整理的成功解决FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `ar的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ML之DT:基于DT决策树算法(对比是否
- 下一篇: 成功解决TypeError: only