Apologies in advance for duplicate question, but I have yet to find a solution that works from previous questions.
I am unable to join two data-frames with different MultiIndexes. I want to keep all the columns from both data-frames.
Given that df1 has ~300k rows and df2 has ~50k rows the join would be many:1 between df1:df2.
df1 B path_id
cust_id date
11 2015-02-24 10 13
28 2015-02-25 16 22
23 2015-02-26 21 19
15 2015-02-27 11 28
18 2015-02-28 29 10
df2 C
cust_id path_id
11 13 10
28 22 26
23 19 22
15 28 27
18 10 18
The goal is to assign column C
to all matching combinations of index cust_id
& column path_id
. See df3 below as an example.
df3 B C path_id
cust_id date
11 2015-02-24 10 10 13
28 2015-02-25 16 26 22
23 2015-02-26 21 22 19
15 2015-02-27 11 27 28
18 2015-02-28 29 18 10
Appreciate any response on this. Thank you!