您当前的位置: 首页 >  ar
  • 0浏览

    0关注

    2393博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

成功解决FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `ar

一个处女座的程序猿 发布时间:2019-03-04 10:57:53 ,浏览量:0

成功解决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)]即可!

关注
打赏
1664196048
查看更多评论
立即登录/注册

微信扫码登录

0.0919s