code: 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')
docs: Need to dedupe columns that have the same name.