DOC: Added examples to pd.Index.get_loc
State: closed

This pull request adds some examples to ``Index.get_loc`` (actually to ``Index._index_shared_docs['get_loc']``) and clarifies the return value.



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

Comments:
Hello @topper-123! Thanks for updating the PR.



Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on September 01, 2017 at 14:02 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17380?src=pr&el=h1) Report
> Merging [#17380](https://codecov.io/gh/pandas-dev/pandas/pull/17380?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/77bfe21c7229e724d01721bb84861283baf7e9d3?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #17380      +/-   ##
==========================================
- Coverage   91.01%   90.99%   -0.02%     
==========================================
  Files         163      163              
  Lines       49570    49570              
==========================================
- Hits        45116    45107       -9     
- Misses       4454     4463       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.77% <ø> (ø)` | :arrow_up: |
| #single | `40.26% <ø> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17380?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/17380?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `95.88% <ø> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17380?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17380?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.72% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17380?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/17380?src=pr&el=footer). Last update [77bfe21...f03c140](https://codecov.io/gh/pandas-dev/pandas/pull/17380?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/17380?src=pr&el=h1) Report
> Merging [#17380](https://codecov.io/gh/pandas-dev/pandas/pull/17380?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/dad39d593eacd1ee2b2465dc2ac025b0cfaffe2a?src=pr&el=desc) will **decrease** coverage by `0.04%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #17380      +/-   ##
==========================================
- Coverage   91.04%   90.99%   -0.05%     
==========================================
  Files         163      163              
  Lines       49581    49581              
==========================================
- Hits        45139    45118      -21     
- Misses       4442     4463      +21
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.77% <100%> (-0.03%)` | :arrow_down: |
| #single | `40.26% <100%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17380?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/17380?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `95.84% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17380?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/17380?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `63.23% <0%> (-1.82%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17380?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.72% <0%> (-0.1%)` | :arrow_down: |

------

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

lgtm. ping push / green.
ping
@jreback Is this ok? 

(More of a general question): I force-pushed the change, is that ok or is it considered "bad form"?

Edit: I made a last-minute update so sub-class name will displayed properly (e.g. CategoricalIndex).
@topper-123 force pushing to your own branch is just fine and in-fact necessary after rebasing.
Hi @jreback. I've updated the examples for other index classes as well, but I've messed up the commits, lots of other people's commit are included also.

Should I just delete this branch and make a new pull request?
@topper-123 generally just push (or force push) to the same branch is easiest, but since you did it ok