BUG: Fix Series.get failure on missing NaN (#8569)
State: closed

Handle obscure case where `.get(np.nan)` wouldn't behave as expected.  Fortunately the only change needed is within the unlikely branch, and so performance of get shouldn't be affected at all in the ordinary case.

[X] fixes #8569
[X] tests added / passed
[X] passes git diff upstream/master --name-only -- '*.py' | flake8 --diff
[X] whatsnew entry

Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

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

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

```diff
@@            Coverage Diff             @@
##           master   #16619      +/-   ##
==========================================
- Coverage   90.96%   90.93%   -0.03%     
==========================================
  Files         161      161              
  Lines       49263    49265       +2     
==========================================
- Hits        44810    44800      -10     
- Misses       4453     4465      +12
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.69% <100%> (-0.03%)` | :arrow_down: |
| #single | `40.22% <0%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16619?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/numeric.py](https://codecov.io/gh/pandas-dev/pandas/pull/16619?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9udW1lcmljLnB5) | `97.12% <100%> (+0.02%)` | :arrow_up: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/16619?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `63.23% <0%> (-1.82%)` | :arrow_down: |

------

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

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

```diff
@@            Coverage Diff             @@
##           master   #16619      +/-   ##
==========================================
- Coverage   90.96%   90.93%   -0.03%     
==========================================
  Files         161      161              
  Lines       49263    49265       +2     
==========================================
- Hits        44810    44800      -10     
- Misses       4453     4465      +12
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.69% <100%> (-0.03%)` | :arrow_down: |
| #single | `40.22% <0%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16619?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/numeric.py](https://codecov.io/gh/pandas-dev/pandas/pull/16619?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9udW1lcmljLnB5) | `97.12% <100%> (+0.02%)` | :arrow_up: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/16619?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `63.23% <0%> (-1.82%)` | :arrow_down: |

------

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

thanks!