CLN: Remove u and u_safe from pandas.compat
State: closed

- [X] xref #25725
- [X] tests added / passed
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

Another incremental step in removing Python 2.  Only non-standard changes were to `pandas/tests/test_strings.py` where I deleted a bunch of code, as removing `u` resulted in duplicate test scenarios.

Labels:
name: Unicode
description: Unicode strings
name: Clean

Comments:
can we remove unicode strings themselves if they e.g. u'....'?
> can we remove unicode strings themselves if they e.g. u'....'?

Yeah, I was thinking that seemed better suited for a separate PR since, after a quick check, there looks to be 1000+ instances of it, and I didn't want to jam too much into a single PR.  Can do it here if you'd prefer.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25852?src=pr&el=h1) Report
> Merging [#25852](https://codecov.io/gh/pandas-dev/pandas/pull/25852?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/6e0f9a971bcd07a4a6283dc03190b4363d42e292?src=pr&el=desc) will **increase** coverage by `0.01%`.
> The diff coverage is `87.14%`.

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

```diff
@@            Coverage Diff             @@
##           master   #25852      +/-   ##
==========================================
+ Coverage   91.45%   91.47%   +0.01%     
==========================================
  Files         172      172              
  Lines       52892    52870      -22     
==========================================
- Hits        48373    48362      -11     
+ Misses       4519     4508      -11
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.03% <80%> (+0.01%)` | :arrow_up: |
| #single | `41.82% <42.85%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25852?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/compat/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9fX2luaXRfXy5weQ==) | `59.82% <ø> (+1.07%)` | :arrow_up: |
| [pandas/core/panel.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcGFuZWwucHk=) | `35.62% <0%> (-0.1%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `89.3% <100%> (ø)` | :arrow_up: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.79% <100%> (ø)` | :arrow_up: |
| [pandas/io/formats/latex.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvbGF0ZXgucHk=) | `100% <100%> (ø)` | :arrow_up: |
| [pandas/compat/pickle\_compat.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9waWNrbGVfY29tcGF0LnB5) | `75.6% <100%> (ø)` | :arrow_up: |
| [pandas/core/strings.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3RyaW5ncy5weQ==) | `98.59% <100%> (ø)` | :arrow_up: |
| [pandas/io/json/json.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vanNvbi5weQ==) | `93.22% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.57% <100%> (ø)` | :arrow_up: |
| [pandas/core/arrays/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2NhdGVnb3JpY2FsLnB5) | `95.96% <100%> (ø)` | :arrow_up: |
| ... and [10 more](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25852?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/25852?src=pr&el=footer). Last update [6e0f9a9...8c68c28](https://codecov.io/gh/pandas-dev/pandas/pull/25852?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/25852?src=pr&el=h1) Report
> Merging [#25852](https://codecov.io/gh/pandas-dev/pandas/pull/25852?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/6e0f9a971bcd07a4a6283dc03190b4363d42e292?src=pr&el=desc) will **increase** coverage by `0.01%`.
> The diff coverage is `87.14%`.

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

```diff
@@            Coverage Diff             @@
##           master   #25852      +/-   ##
==========================================
+ Coverage   91.45%   91.47%   +0.01%     
==========================================
  Files         172      172              
  Lines       52892    52870      -22     
==========================================
- Hits        48373    48362      -11     
+ Misses       4519     4508      -11
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.03% <80%> (+0.01%)` | :arrow_up: |
| #single | `41.82% <42.85%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25852?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/compat/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9fX2luaXRfXy5weQ==) | `59.82% <ø> (+1.07%)` | :arrow_up: |
| [pandas/core/panel.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcGFuZWwucHk=) | `35.62% <0%> (-0.1%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `89.3% <100%> (ø)` | :arrow_up: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.79% <100%> (ø)` | :arrow_up: |
| [pandas/io/formats/latex.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvbGF0ZXgucHk=) | `100% <100%> (ø)` | :arrow_up: |
| [pandas/compat/pickle\_compat.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9waWNrbGVfY29tcGF0LnB5) | `75.6% <100%> (ø)` | :arrow_up: |
| [pandas/core/strings.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3RyaW5ncy5weQ==) | `98.59% <100%> (ø)` | :arrow_up: |
| [pandas/io/json/json.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vanNvbi5weQ==) | `93.22% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.57% <100%> (ø)` | :arrow_up: |
| [pandas/core/arrays/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2NhdGVnb3JpY2FsLnB5) | `95.96% <100%> (ø)` | :arrow_up: |
| ... and [10 more](https://codecov.io/gh/pandas-dev/pandas/pull/25852/diff?src=pr&el=tree-more) | |

------

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

separate is good!
thanks @jschendel  keep em coming!