def reformat_groupings_columns(groupings, reformat_function, function_params=None):
    """
    Runs the reformat_fuction on the columns of each grouping, adds optional *function_params to function call

    Returns a new groupings dict with reformatted columns
    """
    new_groupings={}
    for grouping_name,grouping_values in groupings.items():
        new_groupings[grouping_name]={}
        for grouping_value_name, values in grouping_values.items():
            if grouping_value_name is 'columns':
                if function_params is None:
                    new_groupings[grouping_name][grouping_value_name]= reformat_function(values)
                else:
                    new_groupings[grouping_name][grouping_value_name]= reformat_function(values, *function_params)
            else:
                new_groupings[grouping_name][grouping_value_name]=values
    return new_groupings