[SciPy-dev] bug(s) in scipy.stats

Christoph T. Weidemann ctw@cogsci.i...
Sun Apr 6 14:51:21 CDT 2008

Hi all!

I just submitted the following ticket but wanted to summarize the main
message from the ticket here, because it raises some issues of general

There's currently a bug in the scipy.stats.ttest_1samp function that
stems from the fact that it assumes that
scipy.stats.var defaults to axis=None (like the numpy.var function)
when it really defaults to axis=0.
The function scipy.stats.obrientransform might also be affected by this bug.

Of course this could be easily fixed by specifying the axis keyword in
the calls to scipy.stats.var, but I think it is not a good idea to
have multiple functions with the same name with different interfaces
that calculate (slightly) different things. I think it would be much
better if all var functions (in numpy and scipy) had the same
interface with a boolean keyword to determine if they return the
biased or the unbiased variance (with identical defaults). Of course,
changing the interface (and default behavior) of a basic function such
as scipy.stats.var is likely to break code, so it would require some
thought how to best achieve more consistency. I'd like to hear what
people here think about this issue.


PS: The ticket raises some more specific concerns with the code for
scipy.stats.ttest_1samp, but I thought I'd focus on the
scipy.stats.var function in this message.

More information about the Scipy-dev mailing list