3 from scipy.stats import linregress
4 from scipy.io import read_array, write_array
7 if __name__ == "__main__" :
8 data = read_array(sys.argv[1]) #, atype='Integer' numpy.typecodes
9 gradient, intercept, r_value, p_value, std_err = linregress(data)
10 print "y = %g + %g x" % (intercept, gradient)
11 print "r = ", r_value # correlation coefficient = covariance / (std_dev_x*std_dev_y)
12 print "p = ", p_value # probablility of measuring this ?slope? for non-correlated, normally-distruibuted data
13 print "err = ", std_err # root mean sqared error of best fit