Skip to content

_num2binvec issue #15

@Szepi

Description

@Szepi

Hi,
Not sure whether this is the official source.
Long story short, I was trying to use pyvttbl, following the code here:
http://www.marsja.se/two-way-anova-repeated-measures-using-python/
The example breaks on line:
aov = df.anova('rt', sub='Sub_id', wfactors=['iv1', 'iv2'])
The end of the error message is:

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyvttbl/stats/_anova.pyc in _num2binvec(self, d, p)
   1238                 d=floor(d/2.)
   1239
-> 1240         return list(array(list(zeros((p-len(b))))+b)+1.)
   1241
   1242 ##    def output2html(self, fname, script=''):

TypeError: 'float' object cannot be interpreted as an index

The problem is that num2binvec converts p to float, and zeros does not look a float argument.
I wonder how this was working before?
Anyhow, by just replacing line 1240 with
return list(array(list(zeros((int(p)-len(b))))+b)+1.)
on my computer, the problem goes away.
I am using a freshly installed python-2.7 on Mac and I installed python packages using port (they supposed to be the latest and bestest).
Cheers,
Csaba

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions