March 2020
Beginner to intermediate
352 pages
8h 40m
English
Binomial distribution, as the name suggests, has only two possible outcomes, success or failure. The outcomes do not need to be equally likely and each trial is independent of the other.
Let's generate a binomial distribution graph using the scipy.stats module by the binom method:
from scipy.stats import binombinomial_data = binom.rvs(n=10, p=0.8,size=10000)axis = sns.distplot(binomial_data, kde=False, color='red', hist_kws={"linewidth": 15})axis.set(xlabel='Binomial Distribution', ylabel='Frequency')
The output of the preceding code is given in the following diagram:

The binom.rvs() method from the scipy.stats module ...
Read now
Unlock full access