MCPcopy Index your code
hub / github.com/clips/pattern / variance

Function variance

pattern/db/__init__.py:342–347  ·  view source on GitHub ↗

Returns the variance of the given list of values. The variance is the average of squared deviations from the mean.

(list)

Source from the content-addressed store, hash-verified

340 return float(_sum(list)) / (len(list) or 1)
341
342def variance(list):
343 """ Returns the variance of the given list of values.
344 The variance is the average of squared deviations from the mean.
345 """
346 a = avg(list)
347 return _sum([(x-a)**2 for x in list]) / (len(list)-1 or 1)
348
349def stdev(list):
350 """ Returns the standard deviation of the given list of values.

Callers 1

stdevFunction · 0.70

Calls 2

lenFunction · 0.85
avgFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…