Skip to content

Instantly share code, notes, and snippets.

@lylayang
Last active October 2, 2019 07:55
Show Gist options
  • Save lylayang/27015743e4c0ba52fe23db5ee687ae76 to your computer and use it in GitHub Desktop.
Save lylayang/27015743e4c0ba52fe23db5ee687ae76 to your computer and use it in GitHub Desktop.
from statsmodels.stats.proportion import proportions_ztest
import pandas as pd
import numpy as np
conversions = np.array([486, 527])
clicks = np.array([5000, 5000])
zscore, pvalue = proportions_ztest(conversions, clicks, alternative = 'two-sided')
print('zscore = {:.4f}, pvalue = {:.4f}'.format(zscore, pvalue))
# [output]: zscore = -1.3589, pvalue = 0.1742
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment