[SciPy-Dev] warnings in scipy.stats.entropy
Pauli Virtanen
pav at iki.fi
Tue May 22 05:15:11 EDT 2012
Skipper Seabold <jsseabold <at> gmail.com> writes:
[clip]
> Currently in scipy.stats.entropy if you are not ignoring them you will
> see warnings when the function is given a probability of zero even
> though the case of zero is specifically handled in the function.
> Rightly or wrongly this makes me cringe. What do people think about
> fixing this by using seterr explicitly in the function or masking the
> zeros.
I'd rather add `xlogy(x, y) = x*log(y)` that treats the case `x==0` specially to
scipy.special, than kludge around the issue by masking or turning warnings off.
--
Pauli Virtanen
More information about the SciPy-Dev
mailing list