def parse_month(date_str):
    if date_str is None or date_str == "":
        raise ValueError('Invalid date', date_str)
    return fmt_date(parse_date_to_obj(date_str).replace(day=1))
>>> parse_month('1-Feb-2011')
dataset/ETHPy150Open practo/r5d4/r5d4/mapping_functions.py/parse_month