Return mode even if single value (#15714)
State: closed

- [X] Please accept this PR which closes #15714 
- [X] Tests added — `test_mode_single`
- [X] Passes ``git diff upstream/master | flake8 --diff`` (however: it complains about some non-changed rows in hashtable_func_helper.pxi.in)

Labels:
name: Bug
name: Algos
description: Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff

Comments:
@buyology looks like a couple of failing tests. I think we tests this condition of a single object for multiple types, so need to change it in each.
Tests updated
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15744?src=pr&el=h1) Report
> Merging [#15744](https://codecov.io/gh/pandas-dev/pandas/pull/15744?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/b1e29dba26ff86b826fe0f866182466ae42c0bc5?src=pr&el=desc) will **decrease** coverage by `0.03%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #15744      +/-   ##
==========================================
- Coverage   91.01%   90.98%   -0.04%     
==========================================
  Files         143      143              
  Lines       49380    49401      +21     
==========================================
+ Hits        44943    44946       +3     
- Misses       4437     4455      +18
```


| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15744?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/15744?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.56% <ø> (-0.41%)` | :arrow_down: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/15744?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `94.86% <ø> (ø)` | :arrow_up: |
| [pandas/core/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/15744?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY2F0ZWdvcmljYWwucHk=) | `95.85% <100%> (-1.05%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/15744?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/tseries/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/15744?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvY29tbW9uLnB5) | `88.09% <0%> (-1.07%)` | :arrow_down: |
| [pandas/types/cast.py](https://codecov.io/gh/pandas-dev/pandas/pull/15744?src=pr&el=tree#diff-cGFuZGFzL3R5cGVzL2Nhc3QucHk=) | `85.31% <0%> (-0.14%)` | :arrow_down: |
| [pandas/io/stata.py](https://codecov.io/gh/pandas-dev/pandas/pull/15744?src=pr&el=tree#diff-cGFuZGFzL2lvL3N0YXRhLnB5) | `93.47% <0%> (-0.05%)` | :arrow_down: |
| [pandas/core/algorithms.py](https://codecov.io/gh/pandas-dev/pandas/pull/15744?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYWxnb3JpdGhtcy5weQ==) | `94.43% <0%> (-0.05%)` | :arrow_down: |
| ... and [14 more](https://codecov.io/gh/pandas-dev/pandas/pull/15744?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15744?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/15744?src=pr&el=footer). Last update [b1e29db...8c08cd5](https://codecov.io/gh/pandas-dev/pandas/pull/15744?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
can you add a whatsnew note (Bug Fix section). small comment, otherwise lgtm. ping on green.
can you update
thanks @buyology 

nice PR!

keep em coming!