"double_scalars中遇到无效值"警告,可能是numpy [英] 'invalid value encountered in double_scalars' warning, possibly numpy

查看:2090
本文介绍了"double_scalars中遇到无效值"警告,可能是numpy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行代码时,我偶尔会收到这些警告,通常是四个警告.我试图通过在某些语句之前和之后放置调试消息来定位源,以查明源.

As I run my code I get these warnings, always in groups of four, sporadically. I have tried to locate the source by placing debug messages before and after certain statements to pin-point its origin.

Warning: invalid value encountered in double_scalars
Warning: invalid value encountered in double_scalars
Warning: invalid value encountered in double_scalars
Warning: invalid value encountered in double_scalars

这是一个Numpy警告,什么是双标量?

Is this is a Numpy warning, and what is a double scalar?

我从Numpy中使用

min(), argmin(), mean() and random.randn()

我也使用Matplotlib

I also use Matplotlib

推荐答案

它看起来像是浮点计算错误.检查 numpy.seterr 函数以获取有关的更多信息发生的地方.

It looks like a floating-point calculation error. Check the numpy.seterr function to get more information about where it happens.

这篇关于"double_scalars中遇到无效值"警告,可能是numpy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆