[SciPy-User] int32 overflow and sqrt of -ve number in scipy.stats.wilcoxon
Simon Baldwin
simonb at google.com
Fri Mar 22 08:43:42 EDT 2013
I have run into two distinct but possibly connected failure modes in
scipy.stats.wilcoxon. Before bug-reporting, I'd appreciate any
thoughts on these.
The first is an int32 overflow that occurs where a count of data ties
exceeds 46341. This occurs in my real data set, comprising around
0.7M samples. The cause is 32-bit counts returned by dfreps() in
futilmodule.c. Minimal failing demonstration:
import numpy
import scipy.stats
numpy.seterr(all='raise')
# Raises: FloatingPointError: overflow encountered in int_scalars,
morestats.py, line 1242
scipy.stats.wilcoxon([0.1] * 46341) # 46341^2 > 2^31-1
The second arises from an attempt to take sqrt of a negative number.
Again, this is in wilcoxon data tie handling and occurs in real data.
Demonstration:
import numpy
import scipy.stats
numpy.seterr(all='raise')
# Raises: FloatingPointError: invalid value encountered in sqrt,
morestats.py, line 1244
scipy.stats.wilcoxon([0.1] * 10)
Both on scipy version 0.9, the latest I have access to. I've taken a
quick look at the 0.11 code for wilcoxon, and didn't notice any
visible functional change.
Thanks.
--
Google UK Limited | Registered Office: Belgrave House, 76 Buckingham
Palace Road, London SW1W 9TQ | Registered in England Number: 3977902
More information about the SciPy-User
mailing list