title: Python: sum column if matches
body: <p>i have a huge file with thousand of lines that looks like this:</p>
  
  <pre><code>`C509.TCGA-78-7159-10A-01D-2036-08.1-C509.  1   0   0   1   0   0
   C509.TCGA-78-7159-10A-01D-2036-08.1-C509.  0   1   1   0   1   1`
  </code></pre>
  
  <p>If the first column of rows matches I want to sum second column of one row with second column of second row, third with third etc, <strong>not using pandas</strong>. And probably it would be better to use python, not awk because of the size.</p>
  
  <p>The output should be:</p>
  
  <blockquote>
    <p><code>C509.TCGA-78-7159-10A-01D-2036-08.1-C509. 1 1 1 1 1 1</code></p>
  </blockquote>
  
  <p>Thank you for help :)</p>