DOC: improve DataFrame/SeriesGroupBy.apply doc string
State: closed

- [x ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

The doc strings for the ``apply`` method on GroupBy objects are currently IMO difficult to "translate" into working code. This PR proposes making the doc string more practical, including:
* split the doc string up for dataframe and series GroupBy object
* have some working examples
* advice people to use other methods if possible because of speed penalty.



Labels:
name: Docs
name: Groupby

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18534?src=pr&el=h1) Report
> Merging [#18534](https://codecov.io/gh/pandas-dev/pandas/pull/18534?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/88ab6934e78117359719eb09c7d580906155575d?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #18534      +/-   ##
==========================================
- Coverage   91.35%   91.33%   -0.02%     
==========================================
  Files         164      164              
  Lines       49801    49804       +3     
==========================================
- Hits        45494    45488       -6     
- Misses       4307     4316       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.13% <100%> (ø)` | :arrow_up: |
| #single | `40.81% <100%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18534?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/groupby.py](https://codecov.io/gh/pandas-dev/pandas/pull/18534?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS5weQ==) | `92.04% <100%> (+0.01%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18534?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18534?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.81% <0%> (-0.1%)` | :arrow_down: |

------

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

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

```diff
@@            Coverage Diff             @@
##           master   #18534      +/-   ##
==========================================
- Coverage   91.35%   91.33%   -0.02%     
==========================================
  Files         164      164              
  Lines       49801    49804       +3     
==========================================
- Hits        45494    45488       -6     
- Misses       4307     4316       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.13% <100%> (ø)` | :arrow_up: |
| #single | `40.81% <100%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18534?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/groupby.py](https://codecov.io/gh/pandas-dev/pandas/pull/18534?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS5weQ==) | `92.04% <100%> (+0.01%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18534?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18534?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.81% <0%> (-0.1%)` | :arrow_down: |

------

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

thanks!
Thanks and thanks for all the help, you're giving!

When is 0.21.1 planned for release?