BUG: Fix Series.is_unique with single occurrence of NaN
State: closed

- [X] closes #25180
- [X] tests added / passed
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [X] whatsnew entry

Labels:
name: Bug
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Comments:
lgtm. if we have sufficient tests, merge on green, otherwise if you can add.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25182?src=pr&el=h1) Report
> Merging [#25182](https://codecov.io/gh/pandas-dev/pandas/pull/25182?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/2d8f0ab1a127d594cd9e24f5d74a2e66c10beabb?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #25182      +/-   ##
==========================================
- Coverage   92.37%   92.37%   -0.01%     
==========================================
  Files         166      166              
  Lines       52409    52404       -5     
==========================================
- Hits        48413    48408       -5     
  Misses       3996     3996
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.79% <100%> (-0.01%)` | :arrow_down: |
| #single | `42.86% <0%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25182?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/25182/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `97.75% <100%> (ø)` | :arrow_up: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25182/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.8% <0%> (-0.01%)` | :arrow_down: |

------

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

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

```diff
@@            Coverage Diff             @@
##           master   #25182      +/-   ##
==========================================
- Coverage   92.37%   92.35%   -0.03%     
==========================================
  Files         166      166              
  Lines       52409    52314      -95     
==========================================
- Hits        48413    48312     -101     
- Misses       3996     4002       +6
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.78% <ø> (-0.01%)` | :arrow_down: |
| #single | `42.84% <ø> (-0.03%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25182?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/25182/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `97.76% <ø> (ø)` | :arrow_up: |
| [pandas/core/groupby/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/25182/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9vcHMucHk=) | `94.15% <0%> (-2.58%)` | :arrow_down: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/25182/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.39% <0%> (-0.24%)` | :arrow_down: |
| [pandas/core/groupby/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/25182/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9nZW5lcmljLnB5) | `86.98% <0%> (-0.18%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25182/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.65% <0%> (-0.16%)` | :arrow_down: |
| [pandas/core/internals/managers.py](https://codecov.io/gh/pandas-dev/pandas/pull/25182/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzL21hbmFnZXJzLnB5) | `95.95% <0%> (-0.11%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/25182/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `88.05% <0%> (-0.09%)` | :arrow_down: |
| [pandas/core/internals/blocks.py](https://codecov.io/gh/pandas-dev/pandas/pull/25182/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzL2Jsb2Nrcy5weQ==) | `94.1% <0%> (-0.07%)` | :arrow_down: |
| [pandas/core/resample.py](https://codecov.io/gh/pandas-dev/pandas/pull/25182/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzYW1wbGUucHk=) | `97.22% <0%> (-0.02%)` | :arrow_down: |
| [pandas/core/panel.py](https://codecov.io/gh/pandas-dev/pandas/pull/25182/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcGFuZWwucHk=) | `97.9% <0%> (-0.01%)` | :arrow_down: |
| ... and [12 more](https://codecov.io/gh/pandas-dev/pandas/pull/25182/diff?src=pr&el=tree-more) | |

------

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

@jreback : Added index tests.  Didn't see many `is_unique` tests for index; some indexes tested it but other didn't appear to.  Added a test to the base class to test `is_unique` in general, as well as the `NaN` specific issue.  Removed some tests that were made redundant by the common test.
thanks!