[SciPy-user] scipy.stats.ttest_ind broken?

Zachary Pincus zpincus at stanford.edu
Wed Mar 1 03:54:01 CST 2006


Hi folks,

I'm using scipy 0.4.6 with numpy 0.9.5, and I have noticed that the t- 
test in the stats library is broken.


scipy.stats.ttest_ind([1,2,3], [4,5,6])
------------------------------------------------------------------------ 
---
exceptions.TypeError                      Traceback (most recent call  
last)

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/scipy/stats/stats.py in ttest_ind(a, b, axis, printit,  
name1, name2, writemode)
    1461     if type(t) == ArrayType:
    1462         probs = reshape(probs,t.shape)
-> 1463     if len(probs) == 1:
    1464         probs = probs[0]
    1465

TypeError: len() of unsized object

What's happening is that betai is returning a scalar value, which has  
no length. This causes the len(probs) call to fail.

Zach Pincus

Program in Biomedical Informatics and Department of Biochemistry
Stanford University School of Medicine



More information about the SciPy-user mailing list