Reputation: 1508
I have two dataframes which look like this:
df1
index A B
01-01-2021 1 2
01-02-2021 2 3
01-03-2021 5 5
01-04-2021 8 7
df2
index B A
01-03-2021 5 5
01-04-2021 7 8
01-05-2021 11 0
01-06-2021 2 9
I would like to merge them by datetime index and the columns A
and B
. The merged dataframe df
should look like this:
df
index A B
01-01-2021 1 2
01-02-2021 2 3
01-03-2021 5 5
01-04-2021 8 7
01-05-2021 0 11
01-06-2021 9 2
How can I do this?
Upvotes: 2
Views: 114