Mi indexing
State: closed

 - [x] closes #15424
 - [x] closes #15434
 - [x] tests added / passed
 - [x] passes ``git diff upstream/master | flake8 --diff``
 - [x] whatsnew entry

This also fixes indexing with a ``DataFrame``, which was actually not mentioned in #15424 (but it's a twoliner)

Labels:
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: MultiIndex

Comments:
lgtm. just a small test addition. ping when pushed and green.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15425?src=pr&el=h1) Report
> Merging [#15425](https://codecov.io/gh/pandas-dev/pandas/pull/15425?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/f65a6415f15d438432cc6954ead61b052c5d4d60?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.


```diff
@@            Coverage Diff             @@
##           master   #15425      +/-   ##
==========================================
+ Coverage   90.37%   90.37%   +<.01%     
==========================================
  Files         135      135              
  Lines       49463    49467       +4     
==========================================
+ Hits        44702    44707       +5     
+ Misses       4761     4760       -1
```


| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15425?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexing.py](https://codecov.io/gh/pandas-dev/pandas/compare/f65a6415f15d438432cc6954ead61b052c5d4d60...2ba2d5d73d6c8fe15ee21e11a51bfe2d0413144c?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhpbmcucHk=) | `94.22% <100%> (+0.02%)` | :white_check_mark: |
| [pandas/core/common.py](https://codecov.io/gh/pandas-dev/pandas/compare/f65a6415f15d438432cc6954ead61b052c5d4d60...2ba2d5d73d6c8fe15ee21e11a51bfe2d0413144c?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tbW9uLnB5) | `91.36% <ø> (+0.33%)` | :white_check_mark: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15425?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/15425?src=pr&el=footer). Last update [f65a641...2ba2d5d](https://codecov.io/gh/pandas-dev/pandas/compare/f65a6415f15d438432cc6954ead61b052c5d4d60...2ba2d5d73d6c8fe15ee21e11a51bfe2d0413144c?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
The ability to index with a DataFrame is actually a new feature, not a bug fix. And thus it should also documented like that if we include it. 
But, personally, I would not add this. I don't see a compelling reason to have this, and it will only add further complexity to indexing (eg, should the column names align on the level names?)
Ouch, right. I caught #15424 while trying to index with a ``DataFrame`` and getting a ``KeyError: 0``, this led me to think it was a bug and not a missing feature, sorry.

That said, I would _love_ that feature. I understand the "complexity" argument, but I propose to reason backwards: if we don't want the column names to align on the level names, then there's no complexity added - it's already done (and really, ``DataFrame``s become tuples so early that you don't have to special-case anything else). If instead we want this to happen, I will see what I can do.

Concerning this PR: in the first case, I would just add a ``whatsnew`` section, while in the second, I would drop the two incriminated lines (and the related test).
By the way: indexing with a Series is also [not documented](http://pandas.pydata.org/pandas-docs/stable/indexing.html#selection-by-label), right?

~~(only now I realize that not even ``.loc[np.array]`` is supported... which instead we might want to I guess)~~ moved to #15434
yeah I agree with @jorisvandenbossche how is this actually useful? it is just plain confusing, e.g. what dimensions are you actually indexing on? what happens if the levels don't match, or partially match.

I think this is too much of a rabbit hole. Take this our for now (and just leave the series fixing). 

Ok with actually raising NotImplemented Error though if a df is passed like this.

You can raise a separate issue with some well-defined use cases for consideration though.
lgtm. ping on green.
thanks @toobaz