code: def rename_dupe_cols(cols):
      
      counts = {}
      positions = {pos: fld for pos, fld in enumerate(cols)}
  
      for c in cols:
          if c in counts.keys():
              counts[c] += 1
          else:
              counts[c] = 1
  
      fixed_cols = {}
  
      for pos, col in positions.items():
          if counts[col] > 1:
              fix_cols = {pos: fld for pos, fld in positions.items() if fld == col}
              keys = [p for p in fix_cols.keys()]
              min_pos = min(keys)
              cnt = 1
              for p, c in fix_cols.items():
                  if not p == min_pos:
                      cnt += 1
                      c = c + str(cnt)
                      fixed_cols.update({p: c})
  
      positions.update(fixed_cols)
  
      cols = [x for x in positions.values()]
  
      return cols
docs: Takes a list of strings and appends 2,3,4 etc to duplicates. Never
      appends a 0 or 1. Appended #s are not always in order...but if you wrap
      this in a dataframe.to_sql function you're guaranteed to not have dupe
      column name errors importing data to SQL...you'll just have to check
      yourself to see which fields were renamed.