Skip to content

Instantly share code, notes, and snippets.

@SaraM92
Last active July 17, 2020 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SaraM92/ccc7533ea7f5bb54da8d0ffcd3b214bf to your computer and use it in GitHub Desktop.
Save SaraM92/ccc7533ea7f5bb54da8d0ffcd3b214bf to your computer and use it in GitHub Desktop.
#Importing Essential Libraries
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stat
#Genrating the Poisson Distribution
n = np.arange(0, 10)
mu = 2 #average number of events
poisson = stat.poisson.pmf(n, lamda)
plt.plot(n, poisson, '-s', label="Mu = {:f}".format(mu), color="#8d0801")
plt.xlabel('# of Events', fontsize=15)
plt.ylabel('Probability', fontsize=15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment