Skip to content

Instantly share code, notes, and snippets.

@lakshay-arora
Created January 28, 2020 10:01
Show Gist options
  • Save lakshay-arora/1dcecb1329b136e45a883479731fa429 to your computer and use it in GitHub Desktop.
Save lakshay-arora/1dcecb1329b136e45a883479731fa429 to your computer and use it in GitHub Desktop.
from sklearn.preprocessing import StandardScaler
# create an object of the StandardScaler
scaler = StandardScaler()
# fit with the Item_MRP
scaler.fit(np.array(train_data.Item_MRP).reshape(-1,1))
# transform the data
train_data.Item_MRP = scaler.transform(np.array(train_data.Item_MRP).reshape(-1,1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment