title: calculate mean and variance with one iteration
body: <p>I have an iterator of numbers, for example a file object:</p>
  
  <pre><code>f = open("datafile.dat")
  </code></pre>
  
  <p>now I want to compute:</p>
  
  <pre><code>mean = get_mean(f)
  sigma = get_sigma(f, mean)
  </code></pre>
  
  <p>What is the best implementation? Suppose that the file is big and I would like to avoid to read it twice.</p>