Return the arithmatic mean of all values.
193656
def Mean(self):
    """"""
    values = [v for v, _ in self.data if v is not None]
    if not values:
      return None

    # TODO(hanuszczak): Why do we return a floored division result instead of
    # the exact value?
    return sum(values) // len(values)
130384
public static double Mean( int[] values ) {
        int     hits;
        long    total = 0;
        double  mean = 0;

        // for all values
        for ( int i = 0, n = values.length; i < n; i++ ) {
            hits = values[i];
            // accumulate mean
            mean += i * hits;
            // accumalate total
            total += hits;
        }
        return ( total == 0 ) ? 0 : mean / total;
    }
1341965
def mean(self, series, start, limit):
        '''
        
        '''
        return float(np.mean(series[start:limit]))
101949
def get_mean_DEV(sum_ptrm_checks, sum_abs_ptrm_checks, n_pTRM, delta_x_prime):
    
    if not n_pTRM:
        return float('nan'), float('nan')
    mean_DEV = ((old_div(1., n_pTRM)) * (old_div(sum_ptrm_checks, delta_x_prime))) * 100
    mean_DEV_prime= ((old_div(1., n_pTRM)) * (old_div(sum_abs_ptrm_checks, delta_x_prime))) * 100
    return mean_DEV, mean_DEV_prime
111447
def mean(self, **kwargs):
        
        if self._is_transposed:
            kwargs["axis"] = kwargs.get("axis", 0) ^ 1
            return self.transpose().mean(**kwargs)
        # Pandas default is 0 (though not mentioned in docs)
        axis = kwargs.get("axis", 0)
        sums = self.sum(**kwargs)
        counts = self.count(axis=axis, numeric_only=kwargs.get("numeric_only", None))
        if sums._is_transposed and counts._is_transposed:
            sums = sums.transpose()
            counts = counts.transpose()
        result = sums.binary_op("truediv", counts, axis=axis)
        return result.transpose() if axis == 0 else result
858220
def mean(data):
    """"""
    #: http://stackoverflow.com/a/27758326
    n = len(data)
    if n < 1:
        raise ValueError('mean requires at least one data point')
    return sum(data)/n
352894
function mean( x, y ) {
	x = abs( x );
	y = abs( y );
	return x + (y-x)/2.0;
}
561467
public BiFunction<Integer, Integer, Short> mean() {
        return (a, b) -> (short) Math.min(Math.round(1.0f * a / b), 255);
    }
387933
def mad(a):
    '''
    '''
    a = np.asfarray(a).flatten()
    return np.median(np.abs(a - np.median(a)))
172508
def mean_abs(self):
        """"""
        # XXX rename this method
        if len(self.values) > 0:
            return sorted(map(abs, self.values))[len(self.values) / 2]
        else:
            return None
1048746
def _values(self):
        """"""
        return [
            val[1] for serie in self.series for val in
            (serie.interpolated if self.interpolate else serie.points)
            if val[1] is not None and (not self.logarithmic or val[1] > 0)
        ]
984411
def weighted_mean(data, weights=None):
    """"""
    if weights is None:
        return mean(data)
    total_weight = float(sum(weights))
    weights = [weight / total_weight for weight in weights]
    w_mean = 0
    for i, weight in enumerate(weights):
        w_mean += weight * data[i]
    return w_mean
1234163
def mad(self,x, axis=None):
        """"""
        return np.median(np.abs(x - np.median(x, axis)), axis)
1087441
function geometric_mean(x) {
        // The mean of no numbers is null
        if (x.length === 0) return null;

        // the starting value.
        var value = 1;

        for (var i = 0; i < x.length; i++) {
            // the geometric mean is only valid for positive numbers
            if (x[i] <= 0) return null;

            // repeatedly multiply the value by each number
            value *= x[i];
        }

        return Math.pow(value, 1 / x.length);
    }
215923
def mean(self):
    """"""
    if len(self) == 0:
      return float('NaN')
    arr = self.samples()
    return sum(arr) / float(len(arr))
849995
function() {
			// Get the mean
			var mean = this.mean();

			// Get a new stats object to work with
			var nums = this.clone();

			// Map each element of nums to the square of the element minus the
			// mean
			nums.map(function(num) {
				return Math.pow(num - mean, 2);
			});

			// Return the standard deviation
			return Math.sqrt(nums.sum() / (nums.size() - 1));
		}
332407
def mean(array):
    
    n = len(array)

    if n < 1:
        return 0
    elif n == 1:
        return array[0]
    return sum(array) / n