5.4.2.1.1.1. statsmodels.sandbox.formula.Factor.__init__

Factor.__init__(termname, keys, ordinal=False)[source]

Factor is initialized with keys, representing all valid levels of the factor.

If ordinal is False, keys can have repeats: set(keys) is what is used.

If ordinal is True, the order is taken from the keys, and there should be no repeats.