pydata / patsy

Describing statistical models in Python using symbolic formulas
Other
941 stars 103 forks source link

C() in statsmodels formula not working with a Pandas dataframe #207

Closed adityaraute closed 4 months ago

adityaraute commented 4 months ago

I'm trying to use the patsy construct in a statsmodels forumla for OLS as shown in the statsmodels docs.

However, I'm getting the following error when trying to pass a column name as parameter.

image

I wonder if it is possible to make the C feature work with pandas in this way.

adityaraute commented 4 months ago

Apologies, this is not a persisting issue. I realised there was a mistake in my original code.