Last active
August 28, 2020 06:49
-
-
Save behrouz-bakhtiari/bf97f72be4f01e5808b7a9e259fe9c7d to your computer and use it in GitHub Desktop.
This file contains 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 numpy as np | |
import seaborn as sns | |
samples = np.zeros(10000) | |
mu, sigma = 20, 3 | |
for s in range(10000): | |
sample = np.random.normal(mu, sigma, 250) #sample of size 250 | |
x_bar = sample.mean() #calculating sample mean | |
samples[s] = x_bar | |
sns.distplot(samples, hist = True, color = 'darkblue', | |
hist_kws={'edgecolor':'black'}).set(xlabel = 'Sample Mean', | |
ylabel = 'Density') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment