🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to NumPy Notes
Topic #23

Poisson Distribution


Poisson Distribution

Poisson Distribution is a Discrete Distribution.

It estimates how many times an event can happen in a specified time. e.g. If someone eats twice a day what is the probability he will eat thrice?

It has two parameters:

lam - rate or known number of occurrences e.g. 2 for above problem.

size - The shape of the returned array.

Example

  from numpy import random

x = random.poisson(lam=2, size=10)

print(x)

Visualization of Poisson Distribution

Example

  from numpy import random
import matplotlib.pyplot as plt
import seaborn as sns

sns.displot(random.poisson(lam=2, size=1000))

plt.show()

image


Difference Between Normal and Poisson Distribution

Normal distribution is continuous whereas poisson is discrete.

But we can see that similar to binomial for a large enough poisson distribution it will become similar to normal distribution with certain std dev and mean.

Example

from numpy import random
import matplotlib.pyplot as plt
import seaborn as sns

data = {
  "normal": random.normal(loc=50, scale=7, size=1000),

"poisson": random.poisson(lam=50, size=1000)
}

sns.displot(data,
kind="kde")

plt.show()

image


Difference Between Binomial and Poisson Distribution

Binomial distribution only has two possible outcomes, whereas poisson distribution can have unlimited possible outcomes.

But for very large n and near-zero p binomial distribution is near identical to poisson distribution such that n * p is nearly equal to lam.

Example

from numpy import random
import matplotlib.pyplot as plt
import seaborn as sns

data = {
  "binomial": random.binomial(n=1000, p=0.01, size=1000),

"poisson": random.poisson(lam=10, size=1000)
}

sns.displot(data,
kind="kde")

plt.show()

image

Want to go beyond the notes?

Join CodingNow 2.0's NumPy course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Poisson Distribution – FAQs

Quick answers about learning Poisson Distribution in NumPy.

This free note from CodingNow 2.0 explains Poisson Distribution in NumPy — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every NumPy topic on CodingNow 2.0, including Poisson Distribution, is 100% free with no signup required.
With focused practice, most students grasp Poisson Distribution in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now