from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler num_pipeline = Pipeline([('imputer', SimpleImputer(strategy="median")), ('std_scaler', StandardScaler())]) transformed = num_pipeline.fit_transform(numerical_df) numerical_df_transformed = pd.DataFrame(transformed, columns=numerical_df.columns, index=numerical_df.index) numerical_df_transformed
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter