DOC: improved docstring for pandas.pivot
Checklist for the pandas documentation sprint (ignore this if you are doing
an unrelated PR):

- [Y] PR title is "DOC: update the <your-function-or-method> docstring"
- [Y ] The validation script passes: `scripts/validate_docstrings.py <your-function-or-method>`
- [ ] The PEP8 style check passes: `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] The html version looks good: `python doc/make.py --single <your-function-or-method>`
- [Y ] It has been proofread on language by another sprint participant

Please include the output of the validation script below between the "```" ticks:

```
# paste output of "scripts/validate_docstrings.py <your-function-or-method>" here
# between the "```" (remove this comment, but keep the "```")

```

If the validation script still gives errors, but you think there is a good reason
to deviate in this case (and there are certainly such cases), please state this
explicitly.



Hello @irruka! Thanks for submitting the PR.

 - In the file [`pandas/core/reshape/reshape.py`](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py), following are the PEP8 issues :

> [Line 410:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L410): [E101](https://duckduckgo.com/?q=pep8%20E101) indentation contains mixed spaces and tabs
> [Line 410:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L410): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 410:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L410): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace
> [Line 411:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L411): [E101](https://duckduckgo.com/?q=pep8%20E101) indentation contains mixed spaces and tabs
> [Line 412:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L412): [E101](https://duckduckgo.com/?q=pep8%20E101) indentation contains mixed spaces and tabs
> [Line 412:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L412): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 413:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L413): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 414:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L414): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 414:35](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L414): [W291](https://duckduckgo.com/?q=pep8%20W291) trailing whitespace
> [Line 424:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L424): [E101](https://duckduckgo.com/?q=pep8%20E101) indentation contains mixed spaces and tabs
> [Line 424:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L424): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 424:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L424): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace
> [Line 425:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L425): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 428:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L428): [E101](https://duckduckgo.com/?q=pep8%20E101) indentation contains mixed spaces and tabs
> [Line 428:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L428): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 429:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L429): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 431:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L431): [E101](https://duckduckgo.com/?q=pep8%20E101) indentation contains mixed spaces and tabs
> [Line 434:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L434): [E101](https://duckduckgo.com/?q=pep8%20E101) indentation contains mixed spaces and tabs
> [Line 434:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L434): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 435:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L435): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 435:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L435): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace
> [Line 436:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L436): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 437:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L437): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 438:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L438): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 438:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L438): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace
> [Line 439:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L439): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 439:77](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L439): [W291](https://duckduckgo.com/?q=pep8%20W291) trailing whitespace
> [Line 440:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L440): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 441:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L441): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 441:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L441): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace
> [Line 442:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L442): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 443:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L443): [E101](https://duckduckgo.com/?q=pep8%20E101) indentation contains mixed spaces and tabs
> [Line 445:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L445): [E101](https://duckduckgo.com/?q=pep8%20E101) indentation contains mixed spaces and tabs
> [Line 445:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L445): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 446:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L446): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 446:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L446): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace
> [Line 447:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L447): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 448:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L448): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 449:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L449): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 450:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L450): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 450:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L450): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace
> [Line 451:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L451): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 452:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L452): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 453:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L453): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 454:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L454): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 454:29](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L454): [W291](https://duckduckgo.com/?q=pep8%20W291) trailing whitespace
> [Line 455:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L455): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 455:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L455): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace
> [Line 456:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L456): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 457:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L457): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 458:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L458): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 459:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L459): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 460:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L460): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 461:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L461): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 462:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L462): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 463:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L463): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 464:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L464): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 465:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L465): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 466:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L466): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 467:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L467): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 468:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L468): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 469:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L469): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 470:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L470): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 471:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L471): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 472:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L472): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 473:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L473): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 474:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L474): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs
> [Line 475:1](https://github.com/pandas-dev/pandas/blob/6b2df5399c1f64c8eff954c9a4e5aa2e22b8ddd7/pandas/core/reshape/reshape.py#L475): [W191](https://duckduckgo.com/?q=pep8%20W191) indentation contains tabs

 @irruka There was apparently also another PR updating pandas.pivot, which has been merged in the meantime: https://github.com/pandas-dev/pandas/pull/20250 (I hope this was not due to an error in the docstring assignment from our side, in that case: sorry!) 
Can you check the other PR, and see if you have changes in this PR that would still be further improvements compared to what has been merged? And if that is the case, feel free to open a new PR! @jorisvandenbossche think we should be okay to close this given we havn't heard back from @irruka and looks like this was largely addressed in #20250 . @irruka please feel free to re-open if you think otherwise/have any further improvements.