Aggregate mean and std with the given group.
976320
def get_info(df, group, info=['mean', 'std']):
    
    agg = df.groupby(group).agg(info)
    agg.columns = agg.columns.droplevel(0)
    return agg
765607
def within_n_sds(n, series):
    """"""
    z_score = (series - series.mean()) / series.std()
    return (z_score.abs() <= n).all()
660071
def get_mean_and_stddevs(self, sites, rup, dists, imt, stds_types):
        

        mean_list = []
        stddvs_list = []

        # Loop over averaging periods
        for period in self.avg_periods:
            imt_local = SA(float(period))
            # compute mean and standard deviation
            mean, stddvs = self.gmpe.get_mean_and_stddevs(sites, rup, dists,
                                                          imt_local,
                                                          stds_types)
            mean_list.append(mean)
            stddvs_list.append(stddvs[0])  # Support only for total!

        mean_avgsa = 0.
        stddvs_avgsa = 0.

        for i1 in range(self.tnum):
            mean_avgsa += mean_list[i1]
            for i2 in range(self.tnum):
                rho = self.corr_func.get_correlation(self.avg_periods[i1],
                                                     self.avg_periods[i2])
                stddvs_avgsa += rho * stddvs_list[i1] * stddvs_list[i2]

        mean_avgsa /= self.tnum
        stddvs_avgsa = np.sqrt(stddvs_avgsa)/self.tnum

        return mean_avgsa, [stddvs_avgsa]
79441
def agg(self, aggregations):
        
        check_type(aggregations, list)

        new_index = Index(np.array(aggregations, dtype=np.bytes_), np.dtype(np.bytes_))

        return _series_agg(self, aggregations, new_index)
102511
function groupOn(f, xs) {
    return groupBy((a, b) => f(a) === f(b), xs);
}
380648
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        

        dists_mod = copy.deepcopy(dists)
        dists_mod.rrup[dists.rrup <= 5.] = 5.

        return super().get_mean_and_stddevs(
            sites, rup, dists_mod, imt, stddev_types)
368161
private Double aggregate(Datasource ds, Collection<Double> values) {
        return ((values.size() / m_intervalsPer) > ds.getXff()) ? ds.getAggregationFuction().apply(values) : Double.NaN;
    }
374914
def mean(self):
        
        if self._can_use_new_school():
            self._prep_spark_sql_groupby()
            import pyspark.sql.functions as func
            return self._use_aggregation(func.mean)
        self._prep_pandas_groupby()
        return DataFrame.fromDataFrameRDD(
            self._regroup_mergedRDD().values().map(
                lambda x: x.mean()), self.sql_ctx)
283850
def normalize_std_array(vector):
  """"""

  # Initializes variables
  length = 1
  n_samples = len(vector)
  mean = numpy.ndarray((length,), 'float64')
  std = numpy.ndarray((length,), 'float64')
  mean.fill(0)
  std.fill(0)

  # Computes mean and variance
  for array in vector:
    x = array.astype('float64')
    mean += x
    std += (x ** 2)

  mean /= n_samples
  std /= n_samples
  std -= (mean ** 2)
  std = std ** 0.5
  arrayset = numpy.ndarray(shape=(n_samples,mean.shape[0]), dtype=numpy.float64)

  for i in range (0, n_samples):
    arrayset[i,:] = (vector[i]-mean) / std
  return arrayset
193160
public static double StdDev( int[] values, double mean ){
        double  stddev = 0;
        double  diff;
        int     hits;
        int     total = 0;

        // for all values
        for ( int i = 0, n = values.length; i < n; i++ )
        {
            hits = values[i];
            diff = (double) i - mean;
            // accumulate std.dev.
            stddev += diff * diff * hits;
            // accumalate total
            total += hits;
        }

        return ( total == 0 ) ? 0 : Math.sqrt( stddev / (total - 1) );
    }
391667
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        mean, stds = self._get_mean_and_stddevs(sites, rup, dists, imt,
                                                stddev_types)
        stddevs = [np.ones(len(dists.repi))*get_sigma(imt)]
        return mean, stddevs
574936
def grouping_val(self):
        
        grouping = self.grouping
        if grouping is None:
            return ST_Grouping.CLUSTERED
        val = grouping.val
        if val is None:
            return ST_Grouping.CLUSTERED
        return val
922815
def fit(self, X):
        """"""
        min_ = X.min() - EPSILON
        max_ = X.max() + EPSILON
        self.mean = X.mean()
        self.std = X.std()

        super().fit(X, min_, max_)
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
664401
function (aggregate, streams, clb) {
        agg = aggregate; // save it temporary so we can use it in the callback

        debug('');
        var err = self.verifyAggregate(aggregate, cmd);
        if (err) {
          return clb(err);
        }
        clb(null, aggregate, streams);
      }
959188
def weighted_sum(groupe, var):
    '''
    
    '''
    data = groupe[var]
    weights = groupe['pondmen']
    return (data * weights).sum()
974265
def _compute_mean(self, C, mag, rrup):
        
        mean = (C['c1'] +
                self._compute_term1(C, mag) +
                self._compute_term2(C, mag, rrup) +
                self._compute_term3(C, rrup))
        return mean