title: How to calculate the p-value for Poisson distribution in python?
body: <h1>Question</h1>
  <p>Infection rates at a hospital above a 1 infection per 100 person-days at risk are considered high. A hospital had 10 infections over the last 1787 person-days at risk. Give the p-value of the correct one-sided test of whether the hospital is below the standard.</p>
  <p>Question link: <a href="https://towardsdatascience.com/40-statistics-interview-problems-and-answers-for-data-scientists-6971a02b7eee" rel="nofollow noreferrer">https://towardsdatascience.com/40-statistics-interview-problems-and-answers-for-data-scientists-6971a02b7eee</a></p>
  <h1>Setup</h1>
  <pre><code>poisson distribution f(x;lam) = e^-lam   lam^k
                                  ---------------
                                      k!
  
  
  k = 10 # infections
  lam = (1/1000) * 1787
  
  
  Using excel .poission, it gives p-value = 0.032372
  
  
  How to get this value using python?
  </code></pre>
  <h1>How to get p-value using python?</h1>