DOC: Fix docstrings with the sections in the wrong order #24280
State: closed

- [x] closes #24280
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


Labels:
name: Docs

Comments:
Hello @benjaminr! Thanks for updating the PR.

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

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

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

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

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

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

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

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



##### Comment last updated on December 15, 2018 at 23:46 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24288?src=pr&el=h1) Report
> Merging [#24288](https://codecov.io/gh/pandas-dev/pandas/pull/24288?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/7b0fa8e94e22aa4a491fa574bc56f8ca791f7608?src=pr&el=desc) will **decrease** coverage by `49.21%`.
> The diff coverage is `100%`.

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

```diff
@@             Coverage Diff             @@
##           master   #24288       +/-   ##
===========================================
- Coverage   92.22%   43.01%   -49.22%     
===========================================
  Files         162      162               
  Lines       51824    51820        -4     
===========================================
- Hits        47795    22288    -25507     
- Misses       4029    29532    +25503
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `?` | |
| #single | `43.01% <100%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24288?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/accessor.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYWNjZXNzb3IucHk=) | `63.85% <ø> (-34.94%)` | :arrow_down: |
| [pandas/core/window.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvd2luZG93LnB5) | `28.93% <100%> (-67.47%)` | :arrow_down: |
| [pandas/core/groupby/groupby.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9ncm91cGJ5LnB5) | `24.5% <100%> (-72.17%)` | :arrow_down: |
| [pandas/core/resample.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzYW1wbGUucHk=) | `22.73% <100%> (-73.85%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `35.88% <100%> (-61.03%)` | :arrow_down: |
| [pandas/core/groupby/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9nZW5lcmljLnB5) | `13.5% <100%> (-73.63%)` | :arrow_down: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `49.32% <100%> (-44.38%)` | :arrow_down: |
| [pandas/io/formats/latex.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvbGF0ZXgucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/core/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/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/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXNfY29uc3RhbnRzLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| ... and [126 more](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree-more) | |

------

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

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

```diff
@@            Coverage Diff             @@
##           master   #24288      +/-   ##
==========================================
+ Coverage   92.28%   92.28%   +<.01%     
==========================================
  Files         162      162              
  Lines       51831    51837       +6     
==========================================
+ Hits        47830    47837       +7     
+ Misses       4001     4000       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.68% <100%> (ø)` | :arrow_up: |
| #single | `43% <100%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24288?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/window.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvd2luZG93LnB5) | `96.41% <100%> (+0.01%)` | :arrow_up: |
| [pandas/core/groupby/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9nZW5lcmljLnB5) | `87.15% <100%> (+0.03%)` | :arrow_up: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `93.71% <100%> (ø)` | :arrow_up: |
| [pandas/core/groupby/groupby.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9ncm91cGJ5LnB5) | `96.65% <100%> (-0.03%)` | :arrow_down: |
| [pandas/core/resample.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzYW1wbGUucHk=) | `96.58% <100%> (ø)` | :arrow_up: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.91% <100%> (ø)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.66% <100%> (ø)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24288/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.58% <0%> (+0.09%)` | :arrow_up: |

------

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

Also, the errors in the CI are because there is a test comparing that the common methods of `NaT` and `Timestamp` have the same docstrings. You can see a fix to a failure in this same test here: https://github.com/pandas-dev/pandas/pull/24132/commits/5c54db87e93723471a9e9f066d11a85610fb08d5

If you try to reproduce the test failure locally, note that `.pyx` needs to be compiled for the right docstrings to be accessed.
Can you merge master too. We just merged #24132, and with this PR, all the sections should be in the right order now. When you add the check to `ci/code_checks.sh` we'll be sure.
We've got this cases failing in the CI:
```
2018-12-16T17:17:04.7332443Z ##[error]pandas/core/series.py(3305,): error GL07: pandas.Series.agg: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7343114Z ##[error]pandas/core/series.py(3305,): error GL07: pandas.Series.aggregate: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7345657Z ##[error]pandas/core/frame.py(6094,): error GL07: pandas.DataFrame.agg: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7346376Z ##[error]pandas/core/frame.py(6094,): error GL07: pandas.DataFrame.aggregate: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7347044Z ##[error]pandas/core/window.py(1648,): error GL07: pandas.core.window.Rolling.aggregate: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7347714Z ##[error]pandas/core/window.py(1924,): error GL07: pandas.core.window.Expanding.aggregate: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7348542Z ##[error]pandas/core/groupby/generic.py(1305,): error GL07: pandas.core.groupby.DataFrameGroupBy.agg: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7349265Z ##[error]pandas/core/resample.py(256,): error GL07: pandas.core.resample.Resampler.apply: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7350194Z ##[error]pandas/core/resample.py(256,): error GL07: pandas.core.resample.Resampler.aggregate: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
```

If they can't be fixed with the `Appender` the way it is, we may have to split what we are appending, of just generate the string with `.format()`... Do you think you can do it?
No problem, thanks for your patience @datapythonista :)
thanks @benjaminr