'invalid value encountered in double_scalars' warning, possibly numpy
In my case, I found out it was division by zero.
It looks like a floating-point calculation error. Check the numpy.seterr function to get more information about where it happens.