[CLN] De-privatize commonly-used functions
State: closed

Also updated numpy_helper to not use things from numpy's deprecated C API.  This won't get rid of the warnings since cython still causes them, but it's still nice.

Not sure how to lint for this (or if we really want to), will see if google knows.

Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Clean

Comments:
looks ok, something failing.
Messed up whitespace in rebasing, should be fixed now.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21870?src=pr&el=h1) Report
> Merging [#21870](https://codecov.io/gh/pandas-dev/pandas/pull/21870?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/272bbdc72fa2d32d7019bb76ab91817eb5afeaf5?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `97.79%`.

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

```diff
@@            Coverage Diff             @@
##           master   #21870      +/-   ##
==========================================
+ Coverage   91.96%   91.96%   +<.01%     
==========================================
  Files         166      166              
  Lines       50323    50329       +6     
==========================================
+ Hits        46281    46287       +6     
  Misses       4042     4042
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.36% <95.95%> (ø)` | :arrow_up: |
| #single | `42.23% <51.1%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/21870?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/21870/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy90aW1lZGVsdGFzLnB5) | `91.53% <ø> (ø)` | :arrow_up: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/21870/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `94.11% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/category.py](https://codecov.io/gh/pandas-dev/pandas/pull/21870/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9jYXRlZ29yeS5weQ==) | `97.28% <100%> (ø)` | :arrow_up: |
| [pandas/core/dtypes/missing.py](https://codecov.io/gh/pandas-dev/pandas/pull/21870/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL21pc3NpbmcucHk=) | `93.56% <100%> (ø)` | :arrow_up: |
| [pandas/io/formats/format.py](https://codecov.io/gh/pandas-dev/pandas/pull/21870/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvZm9ybWF0LnB5) | `98.24% <100%> (ø)` | :arrow_up: |
| [pandas/core/groupby/grouper.py](https://codecov.io/gh/pandas-dev/pandas/pull/21870/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9ncm91cGVyLnB5) | `98.16% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/21870/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.35% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/range.py](https://codecov.io/gh/pandas-dev/pandas/pull/21870/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9yYW5nZS5weQ==) | `95.7% <100%> (ø)` | :arrow_up: |
| [pandas/core/groupby/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/21870/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9vcHMucHk=) | `96.35% <100%> (ø)` | :arrow_up: |
| [pandas/core/sparse/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/21870/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3BhcnNlL3Nlcmllcy5weQ==) | `95.22% <100%> (+0.01%)` | :arrow_up: |
| ... and [36 more](https://codecov.io/gh/pandas-dev/pandas/pull/21870/diff?src=pr&el=tree-more) | |

------

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

CI failure was a ResourceWarning.  Had to edit something to re-push, so de-privatized _ensure_categorical.
ping.  I'd like to get this out of the way before inevitable merge conflicts arise.
ahh i merged in a funny order, can you rebase
Done
thanks @jbrockmendel !