#NEWLINE# def transform( self , X ) : #NEWLINE# #INDENT# 'Centers a NumPy array.\n\n        Parameters\n        ----------\n        X : {array-like, sparse matrix}, shape = [n_samples, n_features]\n            Array of data vectors, where n_samples is the number of samples and\n            n_features is the number of features.\n\n        Returns\n        --------\n        X_tr : {array-like, sparse matrix}, shape = [n_samples, n_features]\n            A copy of the input array with the columns centered.\n\n        ' #NEWLINE# if ( not hasattr ( self , 'col_means' ) ) : #NEWLINE# #INDENT# raise AttributeError ( 'MeanCenterer has not been fitted, yet.' ) #NEWLINE# #UNINDENT# X_tr = np . copy ( self . _get_array ( X ) ) #NEWLINE# X_tr = np . apply_along_axis ( func1d = ( lambda x : ( x - self . col_means ) ) , axis = 1 , arr = X_tr ) #NEWLINE# return X_tr