'invalid value encountered in double_scalars' warning, possibly numpy


Question

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

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

From Numpy I use

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

I also use Matplotlib

1
54
3/2/2016 4:46:25 PM

Accepted Answer

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

41
9/22/2010 8:22:22 AM

In my case, I found out it was division by zero.


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon