Consider the following example:
import pandas as pd
from pandas import DataFrame
import statsmodels.formula.api as smf
df = DataFrame({'a': [1,2,3], 'b': [2,3,4]})
df2 = DataFrame({'177sdays': [1,2,3], 'b': [2,3,4]})
Then
smf.ols('a ~ b', df)
smf.ols('177sdays ~ b', df2)
And the first work and the second does not. The only difference seems to be the presence of numerical characters in the variable name. Why is this?
Q
can "quote" arbitrary variable names patsy.readthedocs.io/en/latest/… – Housebreak