Assuming a dataframe where values from any of the columns can change, Given another dataframe which contains the old value, new value and column it belongs to, how to update dataframe using information about changes? For example:
>>> my_df
x y z
0 1 2 5
1 2 3 9
2 8 7 2
3 3 4 7
4 6 7 7
my_df_2 contains information about changed values and their columns:
>>> my_df_2
changed_col old_value new_value
0 x 2 10
1 z 9 20
2 x 1 12
3 y 4 23
How to use information in my_df_2 to update my_df such that my_df now becomes:
>>> my_df
x y z
0 12 2 5
1 10 3 20
2 8 7 2
3 3 23 7
4 6 7 7