#NEWLINE# def transform( self , X , y = None , copy = None ) : #NEWLINE# #INDENT# 'Perform standardization by centering and scaling\n\n        Parameters\n        ----------\n        X : array-like, shape [n_samples, n_features]\n            The data used to scale along the features axis.\n        ' #NEWLINE# check_is_fitted ( self , 'scale_' ) #NEWLINE# copy = ( copy if ( copy is not None ) else self . copy ) #NEWLINE# X = check_array ( X , accept_sparse = 'csr' , copy = copy , ensure_2d = False , warn_on_dtype = True , estimator = self , dtype = FLOAT_DTYPES ) #NEWLINE# if ( X . ndim == 1 ) : #NEWLINE# #INDENT# warnings . warn ( DEPRECATION_MSG_1D , DeprecationWarning ) #NEWLINE# #UNINDENT# if sparse . issparse ( X ) : #NEWLINE# #INDENT# if self . with_mean : #NEWLINE# #INDENT# raise ValueError ( 'Cannot center sparse matrices: pass `with_mean=False` instead. See docstring for motivation and alternatives.' ) #NEWLINE# #UNINDENT# if ( self . scale_ is not None ) : #NEWLINE# #INDENT# inplace_column_scale ( X , ( 1 / self . scale_ ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if self . with_mean : #NEWLINE# #INDENT# X -= self . mean_ #NEWLINE# #UNINDENT# if self . with_std : #NEWLINE# #INDENT# X /= self . scale_ #NEWLINE# #UNINDENT# #UNINDENT# return X