×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Chelsea Trotter
Added: Apr 21, 2022 8:30 PM
Views: 7
  1. def update_df(df, update_df, index_col: list):
  2.     df1 = df.set_index(index_col)
  3.     df2 = update_df.set_index(index_col)
  4.     return df1.combine_first(df2).reset_index()