normalize x to have mean 0 and unity standard deviation
178538
def normalize(x):
    ''''''
    x = x.astype(float)
    x -= x.mean()
    return x / float(x.std())
385308
def preprocess_data(Xs_raw):
    ''''''
    n = len(Xs_raw)
    Xs_raw_mean = sum(X for X in Xs_raw) / n

    return [X - Xs_raw_mean for X in Xs_raw], Xs_raw_mean
642913
def transform_standard_normal(df):
    """"""
    import pandas as pd
    import scipy.stats as stats
    if type(df) == pd.core.frame.DataFrame:
        gc_ranks = df.rank(axis=1)
        gc_ranks = gc_ranks / (gc_ranks.shape[1] + 1)
        std_norm = stats.norm.ppf(gc_ranks)
        std_norm = pd.DataFrame(std_norm, index=gc_ranks.index, 
                                columns=gc_ranks.columns)
    elif type(df) == pd.core.series.Series:
        gc_ranks = df.rank()
        gc_ranks = gc_ranks / (gc_ranks.shape[0] + 1)
        std_norm = stats.norm.ppf(gc_ranks)
        std_norm = pd.Series(std_norm, index=df.index)
    return std_norm
1234163
def mad(self,x, axis=None):
        """"""
        return np.median(np.abs(x - np.median(x, axis)), axis)
1143892
public static void normalize(GrayF32 image , float mean , float stdev ) {
		for (int y = 0; y < image.height; y++) {
			int index = image.startIndex + y*image.stride;
			int end = index + image.width;
			while( index < end ) {
				image.data[index] = (image.data[index]-mean)/stdev;
				index++;
			}
		}
	}
880817
def _normalise(self):
        
        if not self.is_unit():
            n = self.norm
            if n > 0:
                self.q = self.q / n
934635
def transform(self, X):
        """"""
        # Note: This maps to mean of distribution, we could alternatively
        # sample from Gaussian distribution
        return self.sess.run(self.z_mean, feed_dict={self.x: X})
931872
def standardize(self, x):
        
        if self.preprocessing_function:
            x = self.preprocessing_function(x)
        if self.rescale:
            x *= self.rescale
        if self.samplewise_center:
            x -= np.mean(x, keepdims=True)
        if self.samplewise_std_normalization:
            x /= np.std(x, keepdims=True) + 1e-7

        if self.featurewise_center:
            if self.mean is not None:
                x -= self.mean
            else:
                warnings.warn('This ImageDataGenerator specifies '
                              '`featurewise_center`, but it hasn\'t '
                              'been fit on any training data. Fit it '
                              'first by calling `.fit(numpy_data)`.')
        if self.featurewise_std_normalization:
            if self.std is not None:
                x /= (self.std + 1e-7)
            else:
                warnings.warn('This ImageDataGenerator specifies '
                              '`featurewise_std_normalization`, but it hasn\'t '
                              'been fit on any training data. Fit it '
                              'first by calling `.fit(numpy_data)`.')
        if self.zca_whitening:
            if self.principal_components is not None:
                flatx = np.reshape(x, (-1, np.prod(x.shape[-3:])))
                whitex = np.dot(flatx, self.principal_components)
                x = np.reshape(whitex, x.shape)
            else:
                warnings.warn('This ImageDataGenerator specifies '
                              '`zca_whitening`, but it hasn\'t '
                              'been fit on any training data. Fit it '
                              'first by calling `.fit(numpy_data)`.')
        return x
684400
def normalize(x:TensorImage, mean:FloatTensor,std:FloatTensor)->TensorImage:
    ""
    return (x-mean[...,None,None]) / std[...,None,None]
991411
function normalize( x ) {
	if ( x !== x || isinfinite( x ) ) {
		return [ x, 0 ];
	}
	if ( x !== 0 && abs( x ) < SMALLEST_FLOAT64 ) {
		return [ x*SCALAR, -52 ];
	}
	return [ x, 0 ];
}
562476
public static void standardize(double[] x) {
        double mu = mean(x);
        double sigma = sd(x);

        if (isZero(sigma)) {
            logger.warn("array has variance of 0.");
            return;
        }

        for (int i = 0; i < x.length; i++) {
            x[i] = (x[i] - mu) / sigma;
        }
    }
1230918
def normalise_angle(th):
    """"""
    return th - (2.0 * np.pi) * np.floor((th + np.pi) / (2.0 * np.pi))
633224
def probability_gt(self, x):
        
        if self.mean is None:
            return
        p = normdist(x=x, mu=self.mean, sigma=self.standard_deviation)
        return 1-p
924829
def normalize(x, min_value, max_value):
    """"""
    x = (x - min_value) / (max_value - min_value)
    return clip(x, 0, 1)
1098311
def standardize_snps(G):
    
    """
    mean = G.mean(0)
    std = G.std(0)
    return (G - mean) / std
942545
def normalAt(self, i):
        """"""
        normals = self.polydata(True).GetPointData().GetNormals()
        return np.array(normals.GetTuple(i))
1112025
def meanAndStdDev(self, limit=None):
        """"""
        if limit is None or len(self.values) < limit:
            limit = len(self.values)
        if limit > 0:
            mean = sum(self.values[-limit:]) / float(limit)
            sumSq = 0.
            for v in self.values[-limit:]:
                sumSq += (v - mean) * (v - mean)
            return mean, math.sqrt(sumSq / limit)
        else:
            return None