ENH: Allow for join between two multi-index dataframe instances
State: closed

closes #16162 
closes #6360 

Allow to join on multiple levels for multi-indexed dataframe instances

Labels:
name: Enhancement
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20356?src=pr&el=h1) Report
> Merging [#20356](https://codecov.io/gh/pandas-dev/pandas/pull/20356?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/e413c491e090274aad78489cc17a2e29cbd8e269?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/20356/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/20356?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #20356      +/-   ##
==========================================
+ Coverage   92.24%   92.25%   +<.01%     
==========================================
  Files         161      161              
  Lines       51339    51376      +37     
==========================================
+ Hits        47360    47397      +37     
  Misses       3979     3979
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.64% <100%> (ø)` | :arrow_up: |
| #single | `42.31% <1.75%> (-0.03%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/20356?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/reshape/merge.py](https://codecov.io/gh/pandas-dev/pandas/pull/20356/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9tZXJnZS5weQ==) | `94.24% <100%> (+0.23%)` | :arrow_up: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/20356/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.48% <100%> (+0.01%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20356?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20356?src=pr&el=footer). Last update [e413c49...8b5d0aa](https://codecov.io/gh/pandas-dev/pandas/pull/20356?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Hello @harisbal! Thanks for updating the PR.

 - There are no PEP8 issues in the file [`pandas/core/indexes/base.py`](https://github.com/harisbal/pandas/blob/ecaf515c59ef8ab67d3b2e62233c7dfc1b746e5d/pandas/core/indexes/base.py) !

 - There are no PEP8 issues in the file [`pandas/core/reshape/merge.py`](https://github.com/harisbal/pandas/blob/ecaf515c59ef8ab67d3b2e62233c7dfc1b746e5d/pandas/core/reshape/merge.py) !

 - There are no PEP8 issues in the file [`pandas/tests/reshape/merge/test_merge.py`](https://github.com/harisbal/pandas/blob/ecaf515c59ef8ab67d3b2e62233c7dfc1b746e5d/pandas/tests/reshape/merge/test_merge.py) !

 - There are no PEP8 issues in the file [`pandas/tests/reshape/merge/test_multi.py`](https://github.com/harisbal/pandas/blob/ecaf515c59ef8ab67d3b2e62233c7dfc1b746e5d/pandas/tests/reshape/merge/test_multi.py) !



##### Comment last updated on November 11, 2018 at 04:31 Hours UTC
Any progress on this?
sorry me take a look. i know this has been outstanding for quite some time.
I'll take a look asap. Cheers
Any idea why pandas-dev.pandas failed?
@harisbal you have been great on this PR. can you merge master and update for the existing comments. Let's get this merged.
Can please someone explain why circleci fails?
on your master you need to push tags, something like

``git push upstream master --tags``

as github uses the tags from that.
How's this looking? I haven't checked on the changes in a while, but CI is passing.
@TomAugspurger I had some more comments. let me have a look again.
@harisbal can you merge master

@TomAugspurger this lgtm. let's merge and can followup on any small issues.
Merged master.  Ping on green.
Shall I try to merge again?
I restarted that crashed worker. I haven't seen that failure before.
All green. Merging.

Thanks!
@jreback @TomAugspurger @WillAyd Thank you so much for everything!!
Sincere apologies for putting you in so much trouble with this PR, I really appreciate your help.
Hopefully my next PR will be smoother.