def order_cat(col, ct, rev=False):
    """
    Small helper to convert column to categorical
    with option to revert order
    """
    col = col.astype(ct)
    if rev:
        col.cat.set_categories(new_categories=ct.categories[::-1],
                               ordered=True, inplace=True)
    return col