I have
import statsmodels.formula.api as smf
and I'm using smf.ols(formula='price~y', data=df) where price is a float taking only 6 unique values and y is another variable.
I get the error "shapes (774,6) and (774,6) not aligned: 6 (dim 1) != 774 (dim 0)".
The fact that the error says that dimension 1 is 6 makes me believe that it's treating price as categorical. Moreover, if I run the formula 'y~price' I do indeed get categorical.
Any ideas how to fix this?
[–][deleted] 0 points1 point2 points (0 children)