title: Scipy expect function not giving expected output
body: <p>When using the expect function for an exponentially distributed random variable, I can't get the intended output. Here is a small example, where I take the expectation over the function "x = 1" over the range 0 to 3. This is equivalent to integrating the density function, so the output should equal the CDF evaluated in 3.</p>
  
  <pre><code>from scipy.stats.distributions import expon
  
  mu = 0.3
  rv = expon(scale=1/mu)
  upper = 3.
  
  print rv.dist.expect(lambda x: 1.,lb = 0.,ub = upper)
  </code></pre>
  
  <p>Which returns 0.950212931632.</p>
  
  <p>The cdf of the exponential distribution evaluated in upper should give the same result:</p>
  
  <pre><code>print rv.cdf(upper)
  </code></pre>
  
  <p>But this gives 0.593430340259.</p>
  
  <p>This may not be the most insightful question, but I don't understand what I'm doing wrong. Does anyone see the mistake? Or is there some mistake in the expect function?</p>