import numpy as np
data = np.random.randn(20, 40)
pipeline = Pipeline([('scaling', StandardScaler()), ('pca', PCA(
    n_components=5))])
pipeline.fit_transform(data)
How to normalize with PCA and scikit-learn