I am trying to perform ANOVA with pyvttbl over my dataset but I get a strange error.
Here is my code:
import pyvttbl
df = pyvttbl.DataFrame()
df.read_tbl("ANOVA_MWE_input.csv")
print df
print type(df)
AN = df.anova('len', sub='id', bfactors=['p1', 'p2'])
The output is:
id name len p1 p2
=========================
0 AAA 32 1 0
1 BBB 33 2 0
2 CCC 29 3 0
3 DDD 22 4 0
<class 'pyvttbl.base.DataFrame'>
Traceback (most recent call last):File "/home/stefano/ownCloud/PycharmProjects/Stockh_cours/ANOVA_MWE.py", line 15, in <module>
AN = df.anova('len', sub='id', bfactors=['p1', 'p2'])
File "/usr/local/lib/python2.7/dist-packages/pyvttbl/base.py", line 1975, in anova
measure=measure, transform=transform, alpha=alpha)
File "/usr/local/lib/python2.7/dist-packages/pyvttbl/stats/_anova.py", line 713, in run
self._between()
File "/usr/local/lib/python2.7/dist-packages/pyvttbl/stats/_anova.py", line 751, in _between
cw = self._num2binvec(e,Nf)
File "/usr/local/lib/python2.7/dist-packages/pyvttbl/stats/_anova.py", line 1240, in _num2binvec
return list(array(list(zeros((p-len(b))))+b)+1.)
TypeError: 'float' object cannot be interpreted as an index
I really don't understand where is a float object in my dataset. Can you help with this? Actually when I then apply this to my real table I get a out of range error. Weirdly with a MWE where only the in_file change I get this.
Thanks for any suggestion.