Created
February 15, 2020 07:57
-
-
Save PrithivirajDamodaran/28e6f35a8fb5c5523b036fbbe2961835 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| %matplotlib inline | |
| from scipy.stats import binom | |
| n = [1,2,10,15,25,50] | |
| p = 0.5 | |
| j = 0 | |
| fig,ax = plt.subplots(nrows=1, ncols=len(n),figsize=(25,2)) | |
| for i in n: | |
| values = range(0,i+1) | |
| bi = binom.pmf(values,i,p) | |
| ax[j].bar(values, bi) | |
| j += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment