Compute the mean by using numpy.average on the first axis.
507500
def mean_curve(values, weights=None):
    
    if weights is None:
        weights = [1. / len(values)] * len(values)
    if not isinstance(values, numpy.ndarray):
        values = numpy.array(values)
    return numpy.average(values, axis=0, weights=weights)
230973
public static double variance(double[] x, double mean) {
        if (x.length == 0) {
            return Double.NaN;
        }
        if (x.length == 1) {
            return 0.0;
        }
        double result = 0.0;
        for (double i : x) {
            result += (i - mean) * (i - mean);
        }
        result /= -1 + x.length;
        return result;
    }
627274
def mean(self):
        
        if self._mean is None:
            self._mean = np.dot(self._K, self.woodbury_vector)
        return self._mean
55538
def mean(l, ignore_nan=False, empty=0):
    
    l = iter(l)
    if ignore_nan:
        l = ifilterfalse(np.isnan, l)
    try:
        n = 1
        acc = next(l)
    except StopIteration:
        if empty == 'raise':
            raise ValueError('Empty mean')
        return empty
    for n, v in enumerate(l, 2):
        acc += v
    if n == 1:
        return acc
    return acc / n
85505
def means_abs_diff(X):
    '''  '''
    return np.mean(np.abs(np.diff(X, axis=1)), axis=1)
1101577
def geometricMean(alldistribT):
    """"""
    return np.exp(np.mean(np.log(alldistribT), axis=1))
1085985
def _compute_mean(self, C, mag, r):
        
        mean = (C['c1'] +
                self._compute_term1(C, mag) +
                self._compute_term2(C, mag, r))
        return mean
421715
def mean(attrs, inputs, proto_obj):
    """"""
    concat_input = [symbol.expand_dims(op_input, axis=0) for op_input in inputs]
    concat_sym = symbol.concat(*concat_input, dim=0)
    mean_sym = symbol.mean(concat_sym, axis=0)
    return mean_sym, attrs, inputs
504436
def get_average_of_timeseries( image, idx=None ):
    
    imagedim = image.dimension
    if idx is None:
        idx = range( image.shape[ imagedim - 1 ] )
    i0 = utils.slice_image( image, axis=image.dimension-1, idx=idx[0] ) * 0
    wt = 1.0 / len( idx )
    for k in idx:
        i0 = i0 + utils.slice_image( image, axis=image.dimension-1, idx=k ) * wt
    return( i0 )
1056618
def _compute_mean(self, C, mag, rrup):
        
        # see table 3, page 14
        R1 = 90.
        R2 = 150.
        # see equation 19, page 32
        m_ref = mag - 4
        r1 = R1 + C['c8'] * m_ref
        r2 = R2 + C['c11'] * m_ref
        assert r1 > 0
        assert r2 > 0
        g0 = np.log10(
            np.sqrt(np.minimum(rrup, r1) ** 2 + (1 + C['c5'] * m_ref) ** 2)
        )
        g1 = np.maximum(np.log10(rrup / r1), 0)
        g2 = np.maximum(np.log10(rrup / r2), 0)

        mean = (C['c0'] + C['c1'] * m_ref + C['c2'] * m_ref ** 2 +
                (C['c3'] + C['c4'] * m_ref) * g0 +
                (C['c6'] + C['c7'] * m_ref) * g1 +
                (C['c9'] + C['c10'] * m_ref) * g2)

        # convert from log10 to ln and units from cm/s2 to g
        mean = np.log((10 ** mean) * 1e-2 / g)

        return mean
656272
def compute(cls, observation, prediction):
        """"""
        assert isinstance(observation, dict)
        try:
            p_value = prediction['mean']  # Use the prediction's mean.
        except (TypeError, KeyError, IndexError):  # If there isn't one...
            try:
                p_value = prediction['value']  # Use the prediction's value.
            except (TypeError, IndexError):  # If there isn't one...
                p_value = prediction  # Use the prediction (assume numeric).
        o_mean = observation['mean']
        o_std = observation['std']
        value = (p_value - o_mean)/o_std
        value = utils.assert_dimensionless(value)
        if np.isnan(value):
            score = InsufficientDataScore('One of the input values was NaN')
        else:
            score = ZScore(value)
        return score
215923
def mean(self):
    """"""
    if len(self) == 0:
      return float('NaN')
    arr = self.samples()
    return sum(arr) / float(len(arr))
918935
def fit(self, x, y, **kwargs):
        
        self.mean = numpy.mean(y)
        return {}
332407
def mean(array):
    
    n = len(array)

    if n < 1:
        return 0
    elif n == 1:
        return array[0]
    return sum(array) / n
1045573
def average(sequence, key):
    """"""
    return sum(map(key, sequence)) / float(len(sequence))
947404
private void computeMean() {
		meanError = 0;

		int size = allPoints.size();
		for (PointIndex<Point> inlier : allPoints) {
			Point pt = inlier.data;

			meanError += modelError.computeDistance(pt);
		}

		meanError /= size;

	}
786542
def average(old_avg, current_value, count):
    
    if old_avg is None:
        return current_value
    return (float(old_avg) * count + current_value) / (count + 1)