title: Mathematical Integration of a function in Python
body: <p>I'm trying to integrate this function:</p>
  
  <p><img src="https://i.stack.imgur.com/LFFf9.png" alt="enter image description here"></p>
  
  <p>However I'm running into an error of: </p>
  
  <pre><code>Traceback (most recent call last):
  
    File "&lt;ipython console&gt;", line 1, in &lt;module&gt;
  
    File "siestats.py", line 349, in NormalDistro
  
      P_inner = scipy.integrate(NDfx,-dev,dev)
  
  TypeError: 'module' object is not callable
  </code></pre>
  
  <p>My code runs this:</p>
  
  <pre><code># Definition of the mathematical function:
  def NDfx(x):
  
      return((1/math.sqrt((2*math.pi)))*(math.e**((-.5)*(x**2))))
  
  # This Function normailizes x, u, and o2 (position of interest, mean and st dev) 
  # and then calculates the probability up to position 'x'
  
  def NormalDistro(u,o2,x):
  
  
      dev = abs((x-u)/o2)
  
  
      P_inner = scipy.integrate(NDfx,-dev,dev)
  
      P_outer = 1 - P_inner
  
      P = P_inner + P_outer/2
  
      return(P)
  </code></pre>
  
  <p>Function NormalDistro is mean for import and used like this:</p>
  
  <pre><code>foo.NormalDistro(30,2.5,1.25)
  </code></pre>
  
  <p>As an example.</p>