def center(self, X):
X = X.copy()<EOL>inan = numpy.isnan(X)<EOL>if self.mu is None:<EOL><INDENT>X_ = numpy.ma.masked_array(X, inan)<EOL>self.mu = X_.mean(<NUM_LIT:0>).base<EOL>self.sigma = X_.std(<NUM_LIT:0>).base<EOL><DEDENT>reduce(lambda y,x: setitem(x[<NUM_LIT:0>], x[<NUM_LIT:1>], x[<NUM_LIT:2>]), zip(X.T, inan.T, self.mu), None)<EOL>X = X - self.mu<EOL>X = X / numpy.where(self.sigma == <NUM_LIT:0>, <NUM_LIT>, self.sigma)<EOL>return X<EOL>
Center `X` in PCA space.