title: Normal distribution: how to get probability under a certain sigma value symmetrically?
body: <p>For Gaussian/normal distribution we know that 1 sigma (standard deviation) around the mode/mean/median encloses almost 68.2% probability; 2 sigma -&gt; 95.4% probability. Is there a function in python that spits out the probability that is enclosed between any given {-x,x} interval? More importantly, I also need the inverse of that function. The inverse function gives me the value of x for which a given probability is enclosed within {-x,x}.</p>
  <p>I searched <code>scipy.stats</code> but could not find my answer. <code>scipy.stats.norm.cdf</code> is the closest one, and I can get the function as: <code>cdf(x)-cdf(-x)</code> and construct the inverse function as:</p>
  <pre><code>import scipy.stats as st
  def fun(x):
      return st.norm.cdf(x)-st.norm.cdf(-x)
  def inv_fun(p):
      p=p+(1.0-p)/2.
      return st.norm.ppf(p)
  </code></pre>
  <p>But I wanted to check if there is already such a function written in <code>scipy</code> or somewhere else.</p>
  <p>Thanks in advance.</p>
  <p>P.S.:
  I know I will attract some negative points here. Please believe me, the probability under {-x,x} is important in many fields.</p>