title: Combine data from csv files
body: <p>I have 100 csv files with the same number of columns (different number of rows) in the following pattern:</p>
  
  <p>Files 1:</p>
  
  <pre><code>A1,B1,C1
  A2,B2,C2
  A3,B3,C3
  A4,B4,C4
  </code></pre>
  
  <p>File 2:</p>
  
  <pre><code>*A1*,*B1*,*C1*
  *A2*,*B2*,*C2*
  *A3*,*B3*,*C3*
  </code></pre>
  
  <p>File ...</p>
  
  <p>Output:</p>
  
  <pre><code>A1+*A1*+...,B1+*B1*+...,C1+*C1*+...
  A2+*A2*+...,B2+*B2*+...,C2+*C2*+...
  A3+*A3*+...,B3+*B3*+...,C3+*C3*+...
  A4+...     ,B4+...     ,C4+...
  </code></pre>
  
  <p>For example: </p>
  
  <p>Files 1:</p>
  
  <pre><code>1,0,0
  1,0,1
  1,0,0
  0,1,0
  </code></pre>
  
  <p>Files 2:</p>
  
  <pre><code>1,1,0
  1,1,1
  0,1,0
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>2,1,0
  2,1,2
  1,1,0
  0,1,0
  </code></pre>
  
  <p>I am really breaking my head on how to solve this... Could any body give me some advise?</p>
  
  <p>Thanks a lot and best regards,
  Julian</p>
  
  <p>Edit:
  I want to thank 'pepr' a lot for his very elaborated answer but I would like to find a solution using pandas as suggested by 'furas'.
  I have found a way to create the variables for all my files like this:</p>
  
  <pre><code>dic={}
  for i in range(14253,14352):
          try:
                  dic['df_{0}'.format(i)]=pandas.read_csv('output_'+str(i)+'.csv')
          except:
                  pass
  </code></pre>
  
  <p>but if I try the suggested</p>
  
  <pre><code>df1['column_A'] += df2['column_*A*']
  </code></pre>
  
  <p>Because I have 100 files in my case it would have to be something like</p>
  
  <pre><code>for residue in residues:
         for number in range(14254,14255):
                 df=dic['df_14253'][residue]
                 df+=dic['df_'+str(number)][residue]
  </code></pre>
  
  <p>I have the problem that my files have different numbers of rows and are only summed up until the last row of df1. How could I solve this? I think groupby.sum by panda could be an option but I don't understand how to use it.</p>
  
  <p>PS: residues is a list which contains all the column headers. </p>