Skip to content

Instantly share code, notes, and snippets.

@PrithivirajDamodaran
Created February 15, 2020 07:57
Show Gist options
  • Save PrithivirajDamodaran/28e6f35a8fb5c5523b036fbbe2961835 to your computer and use it in GitHub Desktop.
Save PrithivirajDamodaran/28e6f35a8fb5c5523b036fbbe2961835 to your computer and use it in GitHub Desktop.
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