成功解决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
?
?
?
目錄
解決問(wèn)題
解決思路
解決方法
?
?
?
?
解決問(wèn)題
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
?
?
?
?
解決思路
未來(lái)的警告:不建議使用非元組序列進(jìn)行多維索引;使用“arr[tuple(seq)]”而不是“arr[seq]”。將來(lái),這將被解釋為一個(gè)數(shù)組索引' arr[np.array(seq)] ',它將導(dǎo)致錯(cuò)誤或不同的結(jié)果。
? return np.add.reduce(sorted[indexer] * weights, axis=axis) / sumval
?
?
?
?
解決方法
此信息提示為警告,而不是error,即使不處理也不會(huì)影響代碼編程的運(yùn)行。如果想要去掉,可以更新庫(kù)至最新版本!
然后根據(jù)提示修改使用方法!
如果想要去掉,可以根據(jù)提示采用改進(jìn)的方法!
將arr[seq]改為arr[tuple(seq)]即可!
總結(jié)
以上是生活随笔為你收集整理的成功解决FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `ar的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: ML之DT:基于DT决策树算法(对比是否
- 下一篇: 成功解决TypeError: only