CLN: reorg groupby to multiple modules
State: closed

makes the impl of groupby a bit easier to grok. 

cc @WillAyd @TomAugspurger @jorisvandenbossche 

Labels:
name: Refactor
description: Internal refactoring of code
name: Groupby

Comments:
if any comments. This has no user facing changes.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21820?src=pr&el=h1) Report
> Merging [#21820](https://codecov.io/gh/pandas-dev/pandas/pull/21820?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/5380fcd4485498ea54210cf9e26fc5000a3d8555?src=pr&el=desc) will **increase** coverage by `0.01%`.
> The diff coverage is `91.68%`.

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

```diff
@@            Coverage Diff             @@
##           master   #21820      +/-   ##
==========================================
+ Coverage    91.9%   91.91%   +0.01%     
==========================================
  Files         160      164       +4     
  Lines       49892    49956      +64     
==========================================
+ Hits        45852    45916      +64     
  Misses       4040     4040
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.29% <91.68%> (+0.01%)` | :arrow_up: |
| #single | `42.16% <18.22%> (+0.06%)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/21820?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/21820/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `96.69% <ø> (-0.15%)` | :arrow_down: |
| [pandas/core/groupby/groupby.py](https://codecov.io/gh/pandas-dev/pandas/pull/21820/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9ncm91cGJ5LnB5) | `96.13% <ø> (+3.44%)` | :arrow_up: |
| [pandas/core/resample.py](https://codecov.io/gh/pandas-dev/pandas/pull/21820/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzYW1wbGUucHk=) | `96.09% <100%> (+0.02%)` | :arrow_up: |
| [pandas/core/reshape/pivot.py](https://codecov.io/gh/pandas-dev/pandas/pull/21820/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9waXZvdC5weQ==) | `97.03% <100%> (ø)` | :arrow_up: |
| [pandas/core/groupby/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/21820/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9fX2luaXRfXy5weQ==) | `100% <100%> (ø)` | :arrow_up: |
| [pandas/core/api.py](https://codecov.io/gh/pandas-dev/pandas/pull/21820/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXBpLnB5) | `100% <100%> (ø)` | :arrow_up: |
| [pandas/core/window.py](https://codecov.io/gh/pandas-dev/pandas/pull/21820/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvd2luZG93LnB5) | `96.27% <100%> (ø)` | :arrow_up: |
| [pandas/core/panel.py](https://codecov.io/gh/pandas-dev/pandas/pull/21820/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcGFuZWwucHk=) | `97.44% <100%> (ø)` | :arrow_up: |
| [pandas/core/groupby/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/21820/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9nZW5lcmljLnB5) | `86.79% <86.79%> (ø)` | |
| [pandas/core/groupby/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/21820/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9iYXNlLnB5) | `91.11% <91.11%> (ø)` | |
| ... and [7 more](https://codecov.io/gh/pandas-dev/pandas/pull/21820/diff?src=pr&el=tree-more) | |

------

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

> There are still a couple of open groupby doc PRs (that we have been merging the last days). Merging this will make updating those harder (but merging those PRs first also give a possibly painful merge here)

better to do file splitting sooner rather than later


ok this is looking pretty good now. split logically. if any more pass. want to merge this soonish to avoid conflicts.
if any other comments

@pandas-dev/pandas-core pretty straightforward split.
merging tomorrow if any comments.