def dedupe_cols(frame):
    """
    Need to dedupe columns that have the same name.
    """

    cols = list(frame.columns)
    for i, item in enumerate(frame.columns):
        if item in frame.columns[:i]:
            cols[i] = "toDROP"
    frame.columns = cols
    return frame.drop("toDROP", 1, errors='ignore')
def dedupe_cols ( frame ) : cols = list ( frame . columns ) for i , item in enumerate ( frame . columns ) : if item in frame . columns [ : i ] : cols [ i ] = "toDROP" frame . columns = cols return frame . drop ( "toDROP" , 1 , errors = 'ignore' )
Need to dedupe columns that have the same name.