title: Python/Numpy/Scipy: Draw Poisson random values with different lambda
body: <p>My problem is to extract in the most efficient way N Poisson random values (<code>RV</code>) each with a different mean/rate <code>Lam</code>. Basically the <code>size(RV) == size(Lam)</code>. </p>
  
  <p>Here it is a naive (very slow) implementation:</p>
  
  <pre><code>import numpy as NP
  
  def multi_rate_poisson(Lam):
      rv = NP.zeros(NP.size(Lam))
      for i,lam in enumerate(Lam):
          rv[i] = NP.random.poisson(lam=lam, size=1)
      return rv
  </code></pre>
  
  <p>That, on my laptop, with 1e6 samples gives:</p>
  
  <pre><code>Lam = NP.random.rand(1e6) + 1
  timeit multi_poisson(Lam)
  1 loops, best of 3: 4.82 s per loop
  </code></pre>
  
  <p>Is it possible to improve from this?</p>