drop the levels of a multi-level column dataframe which are constant
    operates in place

def drop_constant_column_levels(df):
    """
    drop the levels of a multi-level column dataframe which are constant
    operates in place
    """
    columns = df.columns
    constant_levels = [i for i, level in enumerate(columns.levels) if len(level) <= 1]
    constant_levels.reverse()

    for i in constant_levels:
        columns = columns.droplevel(i)
    df.columns = columns