Table of Contents
Factor.
__init__
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.