title: Performing calculations on a tab-delimited file
body: <p>I'm still learning Python and I still don't know how to work with arrays.</p>
  
  <p>I'm want to read a tab-delimited file as for example (but in my case I will have about 400 rows):</p>
  
  <pre><code>  Col1      Col2
    0.0001    0.6
    0.0001    0.5
    0.000006  0.8
    0.0001    0.0003
    0.002     1
    0.002     3
  </code></pre>
  
  <p>I want to get the following output:</p>
  
  <pre><code>Col1      Col2
  0.0001    0.36676667
  0.000006  0.8
  0.002     2
  </code></pre>
  
  <p>So I wanna keep the same value in <strong>Col1</strong> but taking the mean of values in <strong>Col2</strong> which corresponds to the same value in <strong>Col1</strong>.</p>
  
  <p>I can read an array using :</p>
  
  <pre><code>  arr = np.genfromtxt('test.csv', dtype=None, delimiter='\t', skiprows=1)
  </code></pre>
  
  <p>but I don't know how to make these operations and making a new file with the new generated data.</p>
  
  <p>Thanks a lot for any help!</p>