def col_to_cat(df,col_name, dest = False):
    """ Coerces a column in a DataFrame to categorical
    Parameters:
    df - DataFrame
        DataFrame to operate on
    col_name - string
        Name of column to coerce
    dest - bool, default False
        Whether to apply the result to the DataFrame or return it.
        True is apply, False is return.
    """
    new_col = df[col_name].astype('category')
    if dest:
        set_col(df,col_name,new_col)
    else:
        return new_col
Coerces a column in a DataFrame to categorical
    Parameters:
    df - DataFrame
        DataFrame to operate on
    col_name - string
        Name of column to coerce
    dest - bool, default False
        Whether to apply the result to the DataFrame or return it.
        True is apply, False is return.