Skip to content

Instantly share code, notes, and snippets.

@wfaria
Created March 9, 2019 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wfaria/390735f62179f54e7d007c7a8d571f2c to your computer and use it in GitHub Desktop.
Save wfaria/390735f62179f54e7d007c7a8d571f2c to your computer and use it in GitHub Desktop.
Election Poll Simulation - Another Histogram with fixed sample number
fig, axes = plt.subplots(2,3, figsize = (12, 8))
fig.subplots_adjust(hspace=0.4, wspace=0.3)
axes = axes.ravel()
sample_size = [10, 100, 10000, 1000000, 10000000, 100000000000000]
for i in range(len(sample_size)):
sample_means = get_n_sample_means_from_distribution(
samples_number = 100,
sample_size = sample_size[i])
axes[i].hist(sample_means, bins=30)
axes[i].set_title("Sample size: {0}".format(sample_size[i]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment