DOC: Correct wrong doc string for MultiIndex.get_loc_level + added examples
State: closed

- [x ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

The doc string for MultiIndex.get_loc_level is currently wrong. This corrects that + adds some examples.

Labels:
name: Docs
name: MultiIndex

Comments:
tiny comment
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17663?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@9d0db60`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `92.85%`.

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

```diff
@@            Coverage Diff            @@
##             master   #17663   +/-   ##
=========================================
  Coverage          ?   91.24%           
=========================================
  Files             ?      163           
  Lines             ?    49806           
  Branches          ?        0           
=========================================
  Hits              ?    45446           
  Misses            ?     4360           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.04% <92.85%> (?)` | |
| #single | `40.3% <7.14%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17663?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/multi.py](https://codecov.io/gh/pandas-dev/pandas/pull/17663?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9tdWx0aS5weQ==) | `96.9% <92.85%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17663?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/17663?src=pr&el=footer). Last update [9d0db60...3d8933c](https://codecov.io/gh/pandas-dev/pandas/pull/17663?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17663?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@9d0db60`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `92.85%`.

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

```diff
@@            Coverage Diff            @@
##             master   #17663   +/-   ##
=========================================
  Coverage          ?   91.24%           
=========================================
  Files             ?      163           
  Lines             ?    49806           
  Branches          ?        0           
=========================================
  Hits              ?    45446           
  Misses            ?     4360           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.04% <92.85%> (?)` | |
| #single | `40.3% <7.14%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17663?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/multi.py](https://codecov.io/gh/pandas-dev/pandas/pull/17663?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9tdWx0aS5weQ==) | `96.9% <92.85%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17663?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/17663?src=pr&el=footer). Last update [9d0db60...3d8933c](https://codecov.io/gh/pandas-dev/pandas/pull/17663?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

thanks!