DEPR: remove PanelGroupBy, disable DataFrame.to_panel
State: closed

My understanding is that we're removing Panel in 0.25.0.  A local attempt to do this all-at-once got messy quick (largely due to io.pytables and io.msgpack).  This gets the ball rolling by removing only PanelGroupBy and DataFrame.to_panel, followed by all of the code+tests that rely on either of these.

Labels:
name: Deprecate
description: Functionality to remove in pandas

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

```diff
@@            Coverage Diff             @@
##           master   #25047      +/-   ##
==========================================
- Coverage   92.38%   92.33%   -0.05%     
==========================================
  Files         166      166              
  Lines       52401    52309      -92     
==========================================
- Hits        48409    48302     -107     
- Misses       3992     4007      +15
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.77% <100%> (-0.03%)` | :arrow_down: |
| #single | `42.84% <66.66%> (-0.04%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25047?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/groupby/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9nZW5lcmljLnB5) | `86.98% <ø> (-0.18%)` | :arrow_down: |
| [pandas/core/panel.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcGFuZWwucHk=) | `97.9% <ø> (-0.01%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.78% <ø> (-0.15%)` | :arrow_down: |
| [pandas/core/groupby/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9fX2luaXRfXy5weQ==) | `100% <ø> (ø)` | :arrow_up: |
| [pandas/core/resample.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzYW1wbGUucHk=) | `97.22% <100%> (-0.02%)` | :arrow_down: |
| [pandas/io/pytables.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3B5dGFibGVzLnB5) | `92.54% <100%> (+0.22%)` | :arrow_up: |
| [pandas/core/groupby/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9vcHMucHk=) | `94.15% <0%> (-2.58%)` | :arrow_down: |
| [pandas/core/groupby/groupby.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9ncm91cGJ5LnB5) | `95.73% <0%> (-1.07%)` | :arrow_down: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.39% <0%> (-0.24%)` | :arrow_down: |
| ... and [4 more](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25047?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/25047?src=pr&el=footer). Last update [4cbee17...c8dd93a](https://codecov.io/gh/pandas-dev/pandas/pull/25047?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/25047?src=pr&el=h1) Report
> Merging [#25047](https://codecov.io/gh/pandas-dev/pandas/pull/25047?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/e3b095074c5c3b29ec25a994cd204349b872d961?src=pr&el=desc) will **decrease** coverage by `0.03%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #25047      +/-   ##
==========================================
- Coverage   92.37%   92.34%   -0.04%     
==========================================
  Files         166      166              
  Lines       52408    52316      -92     
==========================================
- Hits        48412    48311     -101     
- Misses       3996     4005       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.78% <100%> (-0.02%)` | :arrow_down: |
| #single | `42.83% <66.66%> (-0.03%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25047?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/groupby/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9nZW5lcmljLnB5) | `86.98% <ø> (-0.18%)` | :arrow_down: |
| [pandas/core/panel.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcGFuZWwucHk=) | `97.9% <ø> (-0.01%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.66% <ø> (-0.15%)` | :arrow_down: |
| [pandas/core/groupby/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9fX2luaXRfXy5weQ==) | `100% <ø> (ø)` | :arrow_up: |
| [pandas/core/resample.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzYW1wbGUucHk=) | `97.22% <100%> (-0.02%)` | :arrow_down: |
| [pandas/io/pytables.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3B5dGFibGVzLnB5) | `92.54% <100%> (+0.22%)` | :arrow_up: |
| [pandas/core/groupby/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9vcHMucHk=) | `94.15% <0%> (-2.58%)` | :arrow_down: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.39% <0%> (-0.24%)` | :arrow_down: |
| ... and [3 more](https://codecov.io/gh/pandas-dev/pandas/pull/25047/diff?src=pr&el=tree-more) | |

------

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

> can you add a whatsnew note in Deprecation Removals

Done.
Travis fail looos unrelated
Travis fail fixed
Worth pursuing or close?
thanks @jbrockmendel 

keep em coming on this! (which should do before we remove PY2 stuff).
> My understanding is that we're removing Panel in 0.25.0.

I think what we discussed this summer was to have all bigger deprecations in 0.25 and remove them only before 1.0 (this is what is written down in https://github.com/pandas-dev/pandas/wiki/Pandas-Sprint-(July,-2018), and Panel is also listed in the section to remove in 1.0 in https://github.com/pandas-dev/pandas/issues/6581).

But, given that Panel is already deprecated for a long time (and the process has already started now ..), I don't think I mind much removing it already. But just wanted to note that this might warranted some more discussion before directly starting to remove things to check everybody is on board with that.