Computes the arithmetic mean of a list of numbers. >>> "%.1f" % average([0.9, 0.9, 0.9, 1.0, 0.8, 0.9]) '0.9'
(values)
| 2488 | return kb.cache.content[filename] |
| 2489 | |
| 2490 | def average(values): |
| 2491 | """ |
| 2492 | Computes the arithmetic mean of a list of numbers. |
| 2493 | |
| 2494 | >>> "%.1f" % average([0.9, 0.9, 0.9, 1.0, 0.8, 0.9]) |
| 2495 | '0.9' |
| 2496 | """ |
| 2497 | |
| 2498 | return (1.0 * sum(values) / len(values)) if values else None |
| 2499 | |
| 2500 | @cachedmethod |
| 2501 | def stdev(values): |
no outgoing calls
searching dependent graphs…