def dedupe_cols(df):
    """
    Removes duplicate columns from a dataframe.
    Only the first occurrence of each column label
    is kept.
    """
    tag = "REMOVE_ME_PLEASE"
    cols = list(df.columns)
    for i, item in enumerate(df.columns):
        if item in df.columns[:i]:
            cols[i] = tag
        df.columns = cols
    return df.drop(tag, 1, errors='ignore')