def column_category(categories: List[T]) -> \
        Callable[[T], Tuple[Optional[dict], Optional[str]]]:
    """

    Return a function that gives a categorization value vectorized (see: one hot vector).
    This categorization is a substitution the given value by a vector with all categories and 1 in the category
    supplied.

    :param categories: list
    :return: Optional[str]
    """
    def _app(x: T, e: str=None) -> Tuple[Optional[dict], Optional[str]]:
        if x is None:
            return None, None
        if x not in categories:
            return None, "value {} not found on categories".format(x)
        category_map = OrderedDict([(category, 0) if category != x else (category, 1) for category in categories])
        return category_map, None

    if categories is None or len(categories) == 0:
        return fixed_input(None, "no categories supplied")
    return _app
def column_category ( categories : List [ T ] ) -> Callable [ [ T ] , Tuple [ Optional [ dict ] , Optional [ str ] ] ] : def _app ( x : T , e : str = None ) -> Tuple [ Optional [ dict ] , Optional [ str ] ] : if x is None : return None , None if x not in categories : return None , "value {} not found on categories" . format ( x ) category_map = OrderedDict ( [ ( category , 0 ) if category != x else ( category , 1 ) for category in categories ] ) return category_map , None if categories is None or len ( categories ) == 0 : return fixed_input ( None , "no categories supplied" ) return _app
Return a function that gives a categorization value vectorized (see: one hot vector).
    This categorization is a substitution the given value by a vector with all categories and 1 in the category
    supplied.

    :param categories: list
    :return: Optional[str]