COMPAT: Add keepdims and friends to validation
State: closed

xref https://github.com/pandas-dev/pandas/pull/24227

Labels:
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
Hello @TomAugspurger! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/compat/numpy/function.py`](https://github.com/TomAugspurger/pandas/blob/daab4620c16468d23afe4b41a15bbfbc33f9cfce/pandas/compat/numpy/function.py) !

 - There are no PEP8 issues in the file [`pandas/core/generic.py`](https://github.com/TomAugspurger/pandas/blob/daab4620c16468d23afe4b41a15bbfbc33f9cfce/pandas/core/generic.py) !

 - There are no PEP8 issues in the file [`pandas/tests/series/test_analytics.py`](https://github.com/TomAugspurger/pandas/blob/daab4620c16468d23afe4b41a15bbfbc33f9cfce/pandas/tests/series/test_analytics.py) !


# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24356?src=pr&el=h1) Report
> Merging [#24356](https://codecov.io/gh/pandas-dev/pandas/pull/24356?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/14c33b0e531ba955ae20a6e37750261133e5391e?src=pr&el=desc) will **decrease** coverage by `49.28%`.
> The diff coverage is `81.81%`.

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

```diff
@@             Coverage Diff             @@
##           master   #24356       +/-   ##
===========================================
- Coverage   92.29%   43.01%   -49.29%     
===========================================
  Files         162      162               
  Lines       51808    51825       +17     
===========================================
- Hits        47817    22290    -25527     
- Misses       3991    29535    +25544
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `?` | |
| #single | `43.01% <81.81%> (+0.01%)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24356?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/compat/numpy/function.py](https://codecov.io/gh/pandas-dev/pandas/pull/24356/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9udW1weS9mdW5jdGlvbi5weQ==) | `57.14% <100%> (-30%)` | :arrow_down: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/24356/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `39.62% <50%> (-57.04%)` | :arrow_down: |
| [pandas/io/formats/latex.py](https://codecov.io/gh/pandas-dev/pandas/pull/24356/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvbGF0ZXgucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/core/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/24356/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY2F0ZWdvcmljYWwucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/sas/sas\_constants.py](https://codecov.io/gh/pandas-dev/pandas/pull/24356/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXNfY29uc3RhbnRzLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/tseries/plotting.py](https://codecov.io/gh/pandas-dev/pandas/pull/24356/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvcGxvdHRpbmcucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/tseries/converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/24356/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvY29udmVydGVyLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/formats/html.py](https://codecov.io/gh/pandas-dev/pandas/pull/24356/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvaHRtbC5weQ==) | `0% <0%> (-98.65%)` | :arrow_down: |
| [pandas/core/groupby/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/24356/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9jYXRlZ29yaWNhbC5weQ==) | `0% <0%> (-95.46%)` | :arrow_down: |
| [pandas/io/sas/sas7bdat.py](https://codecov.io/gh/pandas-dev/pandas/pull/24356/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXM3YmRhdC5weQ==) | `0% <0%> (-91.17%)` | :arrow_down: |
| ... and [122 more](https://codecov.io/gh/pandas-dev/pandas/pull/24356/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24356?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/24356?src=pr&el=footer). Last update [14c33b0...82ce910](https://codecov.io/gh/pandas-dev/pandas/pull/24356?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/24356?src=pr&el=h1) Report
> Merging [#24356](https://codecov.io/gh/pandas-dev/pandas/pull/24356?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/88aebed582f5ae898aa78e8b3491c212e92c5d13?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `95.45%`.

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

```diff
@@            Coverage Diff             @@
##           master   #24356      +/-   ##
==========================================
+ Coverage   92.29%   92.29%   +<.01%     
==========================================
  Files         162      162              
  Lines       51808    51825      +17     
==========================================
+ Hits        47817    47833      +16     
- Misses       3991     3992       +1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.7% <95.45%> (ø)` | :arrow_up: |
| #single | `43.01% <81.81%> (+0.01%)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24356?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/compat/numpy/function.py](https://codecov.io/gh/pandas-dev/pandas/pull/24356/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9udW1weS9mdW5jdGlvbi5weQ==) | `87.91% <100%> (+0.77%)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/24356/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.62% <87.5%> (-0.04%)` | :arrow_down: |

------

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

Is this OK to go? It'll let me use our regular validators in https://github.com/pandas-dev/pandas/pull/24227
thanks @TomAugspurger