API/COMPAT: support axis=None for logical reduction (reduce over all axes)
State: closed

- [x] closes #19976
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

This is the minimal fix, just to get np.all / np.any working again.

Some followup items:

1. Expand to all aggregations, not just logical ones
2. Do logical reductions blockwiwse: https://github.com/pandas-dev/pandas/issues/17667. Currently, we do `DataFrame.values`, which isn't necessary for logical reductions.

Labels:
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
Tests are still failing: `np.any`/`np.all` don't seem to work on timedelta data (at least for certain versions of numpy, locally for me it is failing on 1.13)
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21486?src=pr&el=h1) Report
> Merging [#21486](https://codecov.io/gh/pandas-dev/pandas/pull/21486?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/b36b451a74bc16d7ea64c158a3cd33fbfb504068?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `85.71%`.

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

```diff
@@            Coverage Diff             @@
##           master   #21486      +/-   ##
==========================================
- Coverage   91.92%    91.9%   -0.03%     
==========================================
  Files         153      153              
  Lines       49563    49562       -1     
==========================================
- Hits        45559    45548      -11     
- Misses       4004     4014      +10
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.3% <85.71%> (-0.03%)` | :arrow_down: |
| #single | `41.77% <53.57%> (-0.04%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/21486?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/util/\_test\_decorators.py](https://codecov.io/gh/pandas-dev/pandas/pull/21486/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvX3Rlc3RfZGVjb3JhdG9ycy5weQ==) | `92.68% <100%> (+0.18%)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/21486/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.21% <100%> (+0.08%)` | :arrow_up: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/21486/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `94.19% <100%> (ø)` | :arrow_up: |
| [pandas/core/panel.py](https://codecov.io/gh/pandas-dev/pandas/pull/21486/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcGFuZWwucHk=) | `97.43% <62.5%> (-0.44%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/21486/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.19% <90.9%> (-0.05%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/21486/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `85.27% <0%> (-0.7%)` | :arrow_down: |
| [pandas/core/indexing.py](https://codecov.io/gh/pandas-dev/pandas/pull/21486/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhpbmcucHk=) | `93.37% <0%> (-0.05%)` | :arrow_down: |
| [pandas/tseries/offsets.py](https://codecov.io/gh/pandas-dev/pandas/pull/21486/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvb2Zmc2V0cy5weQ==) | `97.16% <0%> (-0.04%)` | :arrow_down: |
| [pandas/core/dtypes/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/21486/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2NvbW1vbi5weQ==) | `94.63% <0%> (-0.02%)` | :arrow_down: |
| [pandas/core/indexes/multi.py](https://codecov.io/gh/pandas-dev/pandas/pull/21486/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9tdWx0aS5weQ==) | `94.97% <0%> (-0.01%)` | :arrow_down: |
| ... and [7 more](https://codecov.io/gh/pandas-dev/pandas/pull/21486/diff?src=pr&el=tree-more) | |

------

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

I think you need to change

```
    @pytest.mark.xfail(
        not _np_version_under1p15,
        reason="failing under numpy-dev gh-19976")
    @pytest.mark.parametrize("axis", [0, 1, None])
    def test_clip_against_frame(self, axis):
        df = DataFrame(np.random.randn(1000, 2))
```

in ``pandas/tests/frame/test_analytics.py`` which was the original failing test, to use your new decorator?

otherwise lgtm.
Good catch. I've removed the xfail entirely, since I think it will pass on all versions now.