Created
June 24, 2016 14:00
-
-
Save drorata/98fd667799909c36d70300c84459fb41 to your computer and use it in GitHub Desktop.
Mean and variance normalization of pandas.DataFrame
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
from sklearn import preprocessing | |
X = pd.DataFrame(np.random.normal(size=(50,4), scale=1, loc=3)) | |
print(X.describe()) | |
scalar = preprocessing.StandardScaler().fit(X) | |
print(pd.DataFrame(scalar.transform(X)).describe()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment