wls function: syntax error "unexpected EOF while parsing" occurs when name of dependent variable starts with digits #1441
Here's the code which produces the error:
=== start of code ===
dates = [dt.datetime(2013, 12, 5), dt.datetime(2013, 12, 6), dt.datetime(2013, 12, 7)]
Note that this error goes away when I replace '2323_HK' with 'HK_2323'. For some reason, the parsing mechanism splits '2323_HK' into '2323 HK' (and something else)... if I'm not wrong
That's a limitation of patsy's way of implementing formulas
python variable names cannot start with a number, but I don't know why the specific error message is raised
quoting works for me
If this can be improved, then it should be on the patsy issue tracker
Thanks for your fast reply! got it, and thanks!
PS it would be great if the statsmodels documentation (specifically, in http://statsmodels.sourceforge.net/stable/example_formulas.html#ols-regression-using-formulas) mentioned something about this limitation of variable naming. i couldn't find any mention of this on the web.