出現FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated的錯誤
2019/09/14 下午 09:04
機器學習共學討論版
William Mok
觀看數:37
回答數:2
收藏數:0
ml100-3-d10
作業 1,2 出了以下 error
C:\Users\user\Anaconda3\lib\site-packages\scipy\stats\stats.py:1713: 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
但可以出圖表
Now scipy version : 1.1.0
回答列表
-
2019/09/14 下午 10:58Jimmy贊同數:0不贊同數:0留言數:1
Hi Mok!
這是未來 scipy 要改版時,提醒你某些程式碼不應該在這樣寫了。主要是用來做 index 的 seq 應該要是 tuple 的資料格式。更詳細的內容可參考
-
2019/09/15 上午 01:52張維元 (WeiYuan)贊同數:1不贊同數:0留言數:1
補充一下:像這種 FutureWarning 的訊息,是告訴你說未來的版本會有更動,建議你參考你的寫法!