Source

pypy / lib_pypy / numpypy / lib / function_base.py

Full commit
1
2
3
4
5
6
7
8
from _numpypy import array

def average(a):
    # This implements a weighted average, for now we don't implement the
    # weighting, just the average part!
    if not hasattr(a, "mean"):
        a = array(a)
    return a.mean()