I'm using the SciPy function kruskal to investigate a statistical database. The SciPy function takes a number of lists as arguments:
from scipy.stats import kruskal
kruskal([1,2,3,4],[5,6,7,8])
(5.3333333333333286, 0.020921335337794052)
kruskal([1,2,3,4],[5,6,7,8],[9,10,11,12])
(9.8461538461538467, 0.007276706499332492)
(I'm just using integers here to show where the datapoints would be - the real datapoints would obviously not be integers)
However if I take a list of lists and try to pass it to the kruskal function this does not work
a=[[1,2,3,4],[5,6,7,8]]
>>> kruskal(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\scipy\stats\stats.py", line 4188, in kruskal
raise ValueError("Need at least two groups in stats.kruskal()")
ValueError: Need at least two groups in stats.kruskal()
After some researching I thought I'd identified the problem - that the arguments needed to be a tuple of lists, rather than a list of lists, but this doesn't work either
kruskal(tuple(a))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\scipy\stats\stats.py", line 4188, in kruskal
raise ValueError("Need at least two groups in stats.kruskal()")
ValueError: Need at least two groups in stats.kruskal()
Thanks in advance for any input.