title: calculate mean using numpy ndarray
body: <p>The text file look like:</p>
  
  <pre><code>david weight_2005 50
  david weight_2012 60
  david height_2005 150
  david height_2012 160
  mark weight_2005 90
  mark weight_2012 85
  mark height_2005 160
  mark height_2012 170
  </code></pre>
  
  <p>How to calculate mean of weight and height for david and mark as follows:</p>
  
  <pre><code>david&gt;&gt; mean(weight_2005 and weight_2012), mean (height_2005 and height_2012)
  mark&gt;&gt; mean(weight_2005 and weight_2012), mean (height_2005 and height_2012)
  </code></pre>
  
  <p>my incomplete code is:</p>
  
  <pre><code> import numpy as np
   import csv
   with open ('data.txt','r') as infile:
     contents = csv.reader(infile, delimiter=' ')
     c1,c2,c3 = zip(*contents)
     data = np.array(c3,dtype=float)
  </code></pre>
  
  <p>Then how to apply np.mean??</p>