I was looking for a way to calculate a score 'x' for each pair of elements in two separate arrays.  The goal of the code is to return an output array containing the score for each entry in the input arrays.  from math import sqrtimport numpy as npdowns = np.genfromtxt('path\file.csv', dtype=long, delimiter=',', skiprows=1, usecols=(1,))ups = np.genfromtxt('path\file.csv', dtype=long, delimiter=',', skiprows=1, usecols=(2,))n = np.add(ups,downs)def _confidence(n):   for i, j in zip[n, ups]:    z = 1.0 #1.0 = 85%, 1.6 = 95%    if n == 0:        return 0     phat = float(ups) / n    x = ((phat + z*z/(2*n) - z * sqrt((phat*(1-phat)+z*z/(4*n))/n))/(1+z*z/n))    print [x]
Confidence score calculation
python;csv;numpy;statistics