Commit efad784a by Eric Coissac

bug patch

parent e201fb13
......@@ -40,7 +40,7 @@ def addStatOptions(optionManager):
action="append", dest="var",
metavar="<Attribute Name>",
default=[],
help="compute the estimator of variance of attribute")
help="compute the estimator of variance of the attribute")
optionManager.add_option('-s','--std-dev',
action="append", dest="sd",
......@@ -85,7 +85,7 @@ def variance(v):
s = reduce(lambda x,y:(x[0]+y,x[1]+y**2),v,(0.,0.))
return s[1]/(len(v)-1) - s[0]**2/len(v)/(len(v)-1)
def var(values,options):
def varpop(values,options):
return statistics(values, options.var, variance)
def sd(values,options):
......@@ -145,7 +145,7 @@ if __name__ == "__main__":
mini,lmini = minimum(values, options)
maxi,lmaxi = maximum(values, options)
avg ,lavg = mean(values, options)
varp ,lvarp = var(values, options)
varp ,lvarp = varpop(values, options)
sigma,lsigma= sd(values, options)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment