def mapper(dictionary):
    """A formatter that map a value to another given a dict.
    Useful to quickly map categorical variables with very few levels (e.g a "sex" variable)
    to something more understandable (or translated).
    """
    return lambda a: dictionary[a] if a in dictionary else a
