pydata / patsy

Describing statistical models in Python using symbolic formulas
Other
954 stars 104 forks source link

How to get Pandas DataFrame with column descriptions? #127

Open Hoeze opened 6 years ago

Hoeze commented 6 years ago

Hi, I'd like to get some dataframe for a given design_info which describes the different rows. E.g. if there is some formula ~ 1 + cat1 + cat2, I'd like to get a dataframe:

cat1   cat2    |   cat1[T.1]   cat1[T.2]   cat1[T.3]   cat2
  A     X      |      0           0           0           0
  A     Y      |      0           0           0           1
 ...

Is this possible with Patsy?