Skip to content

Instantly share code, notes, and snippets.

@eustin
Created May 15, 2023 22:51
Show Gist options
  • Save eustin/3ddd01d5bff4a8a9c5ae9b144c0d56db to your computer and use it in GitHub Desktop.
Save eustin/3ddd01d5bff4a8a9c5ae9b144c0d56db to your computer and use it in GitHub Desktop.
stat_sig_random_11
def plot_hist(experiment_results: np.ndarray,
bins=100,
observed_rate: float = None,
title: str = None) -> None:
sns.histplot(experiment_results, bins=bins)
if observed_rate:
plt.axvline(observed_rate, color='r', label='Diff in rates observed in experiment')
plt.legend(bbox_to_anchor=(0.5, -0.2), loc="lower center")
if title:
plt.title(title)
plt.gca().xaxis.set_major_formatter(ticker.PercentFormatter(xmax=1.0))
sns.despine(left=True, bottom=True)
plt.tight_layout()
plot_hist(simulated_diffs_in_rates,
bins=15,
title="Our range of pure randomness")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment