Open Szepi opened 7 years ago
return list(array(list(zeros(int(p-len(b))))+b)+1.)
This fixed it for me (I'm also using python-2.7 on a Unix server)
Thanks @colizoli, your solution worked for me too - while yours @Szepi was generating a new issue for me:( Anaconda2 on Ubuntu 18.04, pyvttbl 0.5.2.2 and numpy 1.14.3
And what was that issue if you don’t mind me asking? I am curious..
Apologies, I should have mentioned it:
... aov = df.anova('AE',sub='ID',wfactors=['session'])
File "/home/.../anaconda2/lib/python2.7/site-packages/pyvttbl/base.py", line 1973, in anova aov=stats.Anova()
File "/home/.../anaconda2/lib/python2.7/site-packages/pyvttbl/stats/_anova.py", line 605, in init super(Anova, self).init()
TypeError: super(type, obj): obj must be an instance or subtype of type
What type is mentioned at the end? Is the error message cut in half?
Nope, that's all I get :(
Oh, actually, I understand the error message now. But the error message is weird: self at this stage has no reason not to be of type Anova. Between, the two solutions, as far as I can see it, should be equivalent. If you can copy paste here a minimum example that is breaking, I can try to test it.
Apologies @Szepi - but on another computer (Linux Mint 18, just upgraded to pandas 0.23.4) - your solution actually did work just now.
Interesting.. and puzzling.. Thanks for the update!
Hi guys, I got the same issue as yours @basterix (TypeError: super(type, obj): obj must be an instance or subtype of type, for line 605 "super(Anova, self).init()")
Don't ask me why, but I just quit my jupyter notebook from my terminal after having corrected line 1240 (by replacing "p" by "Int(p)", I reopened jupyter notebook, ran my few lines and there was no longer the error from line 605 I don't know if it will work in your case, but it could be useful in the future if you don't want to change your OS to run a "simple" ANOVA ;) Cheers
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: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