title: Image: Numpy random poisson function lam < 0 Value error
body: <p>I start with an image and do some processing on it. One of its stages involves adding Poisson distribution to the image. I have a function taking an array and which returns a poisson distribution image.  In reality when I run the numpy image array through the numpy Poisson function ,I get the following error </p>
  
  <pre><code>File "mtrand.pyx", line 3994, in mtrand.RandomState.poisson
  ValueError: lam &lt; 0
  </code></pre>
  
  <p>My question is it because of my data the error is coming or something else.</p>
  
  <pre><code>import numpy as np
  def poisson(mean, shape=1): #mean is the image np array I want Poisson distribution on
          print(mean.shape,'this is the shape')
          np.savetxt('array.txt',mean,delimiter=',')
          return np.random.poisson(mean)
  </code></pre>
  
  <p>Here is the np array saved in array.txt file. Any help is greatly appreciated.
  <a href="https://drive.google.com/file/d/1bxo49r4qmdaIwxZ7VGV9897TAVU1RIlW/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1bxo49r4qmdaIwxZ7VGV9897TAVU1RIlW/view?usp=sharing</a></p>