def maxabs_scale(X, axis=0, copy=True):
 X = check_array(X, accept_sparse=('csr', 'csc'), copy=False, ensure_2d=False, dtype=FLOAT_DTYPES)
 original_ndim = X.ndim
 if (original_ndim == 1):
  X = X.reshape(X.shape[0], 1)
 s = MaxAbsScaler(copy=copy)
 if (axis == 0):
  X = s.fit_transform(X)
 else:
  X = s.fit_transform(X.T).T
 if (original_ndim == 1):
  X = X.ravel()
 return X

def maxabs_scale ( X , axis = 0 , copy = True ) : X = check_array ( X , accept_sparse = ( 'csr' , 'csc' ) , copy = False , ensure_2d = False , dtype = FLOAT_DTYPES ) original_ndim = X . ndim if ( original_ndim == 1 ) : X = X . reshape ( X . shape [ 0 ] , 1 ) s = MaxAbsScaler ( copy = copy ) if ( axis == 0 ) : X = s . fit_transform ( X ) else : X = s . fit_transform ( X . T ) . T if ( original_ndim == 1 ) : X = X . ravel ( ) return X
scale each feature to the [-1 .