December 2017
Intermediate to advanced
386 pages
10h 42m
English
pmf gives us an output of the mass (probability) associated with each likely output. In the example that we looked at earlier, we have the probability associated with each value of x (although the probabilities vary depending on the value of x).
In this section, we will look at plotting the probability mass function for each possible value of x:
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
ax.plot(x, binom.pmf(x, n, p), 'bo', ms=8, label='binom pmf')[<matplotlib.lines.Line2D at 0x681f474518>]
plt.show() ...
Read now
Unlock full access