title: Correct way to obtain confidence interval with scipy
body: <p>I have a 1-dimensional array of data:</p>
  
  <pre><code>a = np.array([1,2,3,4,4,4,5,5,5,5,4,4,4,6,7,8])
  </code></pre>
  
  <p>for which I want to obtain the 68% confidence interval (ie: the <a href="https://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%9399.7_rule" rel="noreferrer">1 sigma</a>).</p>
  
  <p>The first comment in <a href="https://stackoverflow.com/a/15034101/1391441">this answer</a> states that this can be achieved using <code>scipy.stats.norm.interval</code> from the <a href="http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.norm.html#scipy.stats.norm" rel="noreferrer">scipy.stats.norm</a> function, via:</p>
  
  <pre><code>from scipy import stats
  import numpy as np
  mean, sigma = np.mean(a), np.std(a)
  
  conf_int = stats.norm.interval(0.68, loc=mean, 
      scale=sigma)
  </code></pre>
  
  <p>But a comment in <a href="http://adventuresinpython.blogspot.com.ar/2012/12/confidence-intervals-in-python.html" rel="noreferrer">this post</a> states that the <em>actual</em> correct way of obtaining the confidence interval is:</p>
  
  <pre><code>conf_int = stats.norm.interval(0.68, loc=mean, 
      scale=sigma / np.sqrt(len(a)))
  </code></pre>
  
  <p>that is, sigma is divided by the square-root of the sample size: <code>np.sqrt(len(a))</code>.</p>
  
  <p>The question is: which version is the correct one?</p>