text_plain_output_1.png
from sklearn.preprocessing import StandardScaler

import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

train_data = pd.read_csv('../input/titanic/train.csv')

train_data.shape

def getDatasetDetail(data):
    return pd.DataFrame({'Datatype': data.dtypes.astype(str), 'Non_Null_Count': data.count(axis=0).astype(int), 'Null_Count': data.isnull().sum().astype(int), 'Null_Percentage': round(data.isnull().sum() / len(data) * 100, 2), 'Unique_Values_Count': data.nunique().astype(int)}).sort_values(by='Null_Percentage', ascending=False)

X_train.shape

scaler = StandardScaler()
X_train_sc = scaler.fit_transform(X_train)
X_train_scaled = pd.DataFrame(X_train_sc, columns=X_train.columns)

X_train_scaled.head()