#dropping original values merging scaled values for numerical columns df_og = df.copy() df = df.drop(columns = num_cols, axis = 1) df= df.merge(scaled, left_index=True, right_index=True, how = "left")