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

Function mean

pattern/metrics.py:532–541  ·  view source on GitHub ↗

Returns the arithmetic mean of the given list of values. For example: mean([1,2,3,4]) = 10/4 = 2.5.

(list)

Source from the content-addressed store, hash-verified

530#--- MEAN ------------------------------------------------------------------------------------------
531
532def mean(list):
533 """ Returns the arithmetic mean of the given list of values.
534 For example: mean([1,2,3,4]) = 10/4 = 2.5.
535 """
536 s = 0
537 n = 0
538 for x in list:
539 s += x
540 n += 1
541 return float(s) / (n or 1)
542
543avg = mean
544

Callers 2

varianceFunction · 0.70
momentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…