BUG: Categorical constructor scalar categories
State: closed

Categorical constructor no longer accepts scalars for categories.

Closes #16022

Labels:
name: Categorical
description: Categorical Data Type

Comments:
lgtm.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=h1) Report
> Merging [#16340](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/4cd84582d5ad0fdac5085b12a1affeb6300ba3a3?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/16340/graphs/tree.svg?width=650&height=150&src=pr&token=eZ4WkYLtcO)](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #16340      +/-   ##
==========================================
- Coverage   90.38%   90.36%   -0.03%     
==========================================
  Files         161      161              
  Lines       50916    50918       +2     
==========================================
- Hits        46020    46011       -9     
- Misses       4896     4907      +11
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.13% <100%> (-0.01%)` | :arrow_down: |
| #single | `40.22% <50%> (-0.11%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY2F0ZWdvcmljYWwucHk=) | `95.87% <100%> (+0.01%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `80.56% <0%> (-0.2%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.68% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16340?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/16340?src=pr&el=footer). Last update [4cd8458...91bb0fd](https://codecov.io/gh/pandas-dev/pandas/pull/16340?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/16340?src=pr&el=h1) Report
> Merging [#16340](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/42e2a87f2a8848795238de1259a3daa5612e393d?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/16340/graphs/tree.svg?height=150&width=650&token=eZ4WkYLtcO&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #16340      +/-   ##
==========================================
- Coverage    90.4%   90.36%   -0.05%     
==========================================
  Files         161      161              
  Lines       50933    50935       +2     
==========================================
- Hits        46048    46027      -21     
- Misses       4885     4908      +23
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.13% <100%> (-0.03%)` | :arrow_down: |
| #single | `40.21% <50%> (-0.11%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY2F0ZWdvcmljYWwucHk=) | `95.87% <100%> (+0.01%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `63.23% <0%> (-1.82%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `80.56% <0%> (-0.2%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/16340?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.68% <0%> (-0.1%)` | :arrow_down: |

------

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