I have two dataframes, df1 and df2. df1 have 5 columns id, date1, val1, val2, date2 and df2 contains 3 columns, id, date1, date2.
I want to affect date1 of df2 to date1 of df1 and date2 of df2 to date2 of df1 for all the rows of df1.
df1['date1'] = df2['date1']
df1['date2'] = df2['date2']
content of df1:
id, date1, val1, val2, date2
1, 2020-02-02 xx, xy, 2020-02-02
2, 2020-02-03 xx, xy, 2020-05-03
3, 2020-02-04 xx, xy, 2020-04-04
df2:
3, 2012-12-04, 2023-08-04
The result should be:
1, 2020-02-02 xx, xy, 2020-02-02
2, 2020-02-03 xx, xy, 2020-05-03
3, 2012-12-04,xx, xy, 2023-08-04