title: Is there a python code to concatenate values into 1 cell in excel
body: <p><img src="https://i.stack.imgur.com/qnLLh.jpg" alt="enter image description here"></p>
  
  <p>This is the image that is inside the csv file in excel. However the row on the right(ID), has multiple duplicates of the ID, however has different symbols(left). Is it possible to write a code so as to look for the duplicates of the ID, then append the different symbols to the left of the ID. <br><br>
  Before: <br>
  aaa | 1 <br>
  bbb | 1 <br>
  ccc | 2 <br> 
  <br>
  After: <br>
  aaa,bbb | 1 <br>
  ccc     | 2 <br></p>
  
  <p>So far, I've coded this : <br>
      import win32com.client, csv, os, string
      import os</p>
  
  <pre><code># Office 2010 - Microsoft Office Object 14.0 Object Library
  from win32com.client import gencache
  gencache.EnsureModule('{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}', 0, 2, 5)
                                                                      #
  # Office 2010 - Excel COM
  from win32com.client import gencache
  gencache.EnsureModule('{00020813-0000-0000-C000-000000000046}', 0, 1, 7)
  #
  Application = win32com.client.Dispatch("Excel.Application")
  Application.Visible = True
  Workbook = Application.Workbooks.Add()
  Sheet = Application.ActiveSheet
  #
  
  f= open("gene_test.csv")
  data = csv.reader(f)
  count = 0
  columnA = []
  columnB = []
  columnC = []
  for i in data:
      print i
      count += 1
      Sheet.Range("A"+ str(count)).Value = i[0]
      Sheet.Range("B" + str(count)).Value = i[1]
      Sheet.Range("C" + str(count)).Value = i[2]
      columnA.append(i[0])
      columnB.append(i[1])
      columnC.append(i[2])
      for x in columnA:
         if columnA.count &gt; 1:
             print x
  </code></pre>