def __getitem__(self, key):
        """
        Retrieve the column corresponding to key in a Formula.

        :Parameters:
            key : one of the Factor's keys

        :Returns: ndarray corresponding to key, when evaluated in
                  current namespace
        """
        if not self.ordinal:
            i = self.names().index('(%s==%s)' % (self.termname, str(key)))
            return self()[i]
        else:
            v = self.namespace[self._name]
            return np.array([(vv == key) for vv in v]).astype(np.float)
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/sandbox/formula.py/Factor.__getitem__/original