<jupyter_start><jupyter_text>Types of distributions<jupyter_code>import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import norm
data_normal = norm.rvs(size=10000, loc=0, scale=1)
ax = sns.distplot(data_normal, bins=100, kde=False, color='skyblue', hist_kws={'linewidth':15,'alpha':1})
ax.set(xlabel='Normal', ylabel='Frequency')
from scipy.stats import binom
binom.rvs(n=10, p=0.5)
binom.rvs(size=5, n=10, p=0.5)
data_binom = binom.rvs(n=10, p=0.5, size=10000)
ax = sns.distplot(data_binom, kde = False, color='skyblue', hist_kws={'linewidth': 15, 'alpha': 1})
ax.set(xlabel='Binomial', ylabel='Frequency')
plt.show()
#Import uniform distribution
from scipy.stats import uniform
n = 10000
a = 0
b = 10
# Uniform distribution
data_uni = uniform.rvs(size=n, loc=a, scale=b)
ax = sns.distplot(data_uni, bins=100, kde = False, color='skyblue', hist_kws={'linewidth': 15, 'alpha': 1})
ax.set(xlabel='Uniform', ylabel='Frequency')
plt.show()
from scipy.stats import bernoulli

data_bern = bernoulli.rvs(size=10000, p=0.3)
ax = sns.distplot(data_bern, kde = False, color='skyblue', hist_kws={'linewidth': 15, 'alpha': 1})
ax.set(xlabel='Bernoulli', ylabel='Frequency')
plt.show()
from scipy.stats import poisson

data_pois = poisson.rvs(size=10000, mu=3)
ax = sns.distplot(data_pois, kde = False, color='skyblue', hist_kws={'linewidth': 15, 'alpha': 1})
ax.set(xlabel='Poisson', ylabel='Frequency')
plt.show()
from scipy.stats import gamma

data_gamma = gamma.rvs(a=5, size=10000)
ax = sns.distplot(data_gamma, bins=100, kde = False, color='skyblue', hist_kws={'linewidth': 15, 'alpha': 1})
ax.set(xlabel='Gamma', ylabel='Frequency')
plt.show()
from scipy.stats import lognorm

data_log = lognorm.rvs(0.2, size=10000)
ax = sns.distplot(data_log, bins=100, kde = False, color='skyblue', hist_kws={'linewidth': 15, 'alpha': 1})
ax.set(xlabel='Log Normal', ylabel='Frequency')
plt.show()
from scipy.stats import expon

data_exp = expon.rvs(scale=1, loc=0, size=10000)
ax = sns.distplot(data_exp, bins=100, kde = True, color='skyblue', hist_kws={'linewidth': 15, 'alpha': 1})
ax.set(xlabel='Exponential', ylabel='Frequency')
plt.show()
from scipy.stats import beta

data_beta = beta.rvs(1, 1, size=10000)
ax = sns.distplot(data_beta, kde = False, bins=100, color='skyblue', hist_kws={'linewidth': 15, 'alpha': 1})
ax.set(xlabel='Beta (1,1)', ylabel='Frequency')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17917876399834093, 'fraction_numerical': 0.04977187888842804, 'mean_word_length': 7.2320819112627985, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '588836', 'license': 'MIT', 'n_tokens_mistral': 1055, 'n_tokens_neox': 942, 'n_words': 205, 'path': 'Session_7_Distributions.ipynb', 'repo_name': 'reeha-parkar/applied-statistics', 'size': '2411'}