Search code examples
categorical-datapython

Specifying the form of names for categories generated by patsy/statsmodels 'C'


By default, Patsy's C seems to generate categories with names of the form

C(color, Treatment('White'))[T.Green]

at least when used in a formula provided to statsmodels old. Is there a way to specify that C generate less verbose category names, e.g., of the form

colorGreen

or even simply

Green

Solution

  • There's an issue for this open. Please discuss alternatives there.

    https://github.com/pydata/patsy/issues/19