def proportions_chisquare_allpairs(count, nobs, multitest_method='hs'):
 all_pairs = lzip(*np.triu_indices(len(count), 1))
 pvals = [proportions_chisquare(count[list(pair)], nobs[list(pair)])[1] for pair in all_pairs]
 return AllPairsResults(pvals, all_pairs, multitest_method=multitest_method)

def proportions_chisquare_allpairs ( count , nobs , multitest_method = 'hs' ) : all_pairs = lzip ( * np . triu_indices ( len ( count ) , 1 ) ) pvals = [ proportions_chisquare ( count [ list ( pair ) ] , nobs [ list ( pair ) ] ) [ 1 ] for pair in all_pairs ] return AllPairsResults ( pvals , all_pairs , multitest_method = multitest_method )
chisquare test of proportions for all pairs of k samples performs a chisquare test for proportions for all pairwise comparisons .