Skip to content

Conversation

MatteoRaso
Copy link
Contributor

The documentation for the margins parameter of pivot_table was incorrect. It said that the parameter added rows and columns, but it actually passed them to aggfunc. I used the documentation from the user guide to replace the old documentation, as well as added a sentence to the documentation for aggfunc that explained its role in calculating margins.

  • closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

The documentation for the margins parameter of pivot_table
was incorrect. It said that the parameter added rows and columns,
but it actually passed them to aggfunc. I used the documentation
from the user guide to replace the old documentation, as well as
added a sentence to the documentation for aggfunc that explained
its role in calculating margins.
@mroeschke mroeschke added Docs Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Oct 6, 2022
Co-authored-by: Matthew Roeschke <[email protected]>
@mroeschke mroeschke added this to the 1.6 milestone Oct 6, 2022
@mroeschke mroeschke merged commit ee352b1 into pandas-dev:main Oct 6, 2022
@mroeschke
Copy link
Member

Thanks @MatteoRaso

@MatteoRaso
Copy link
Contributor Author

No problem.

@MatteoRaso MatteoRaso deleted the doc_fix branch October 7, 2022 00:14
@mroeschke mroeschke modified the milestones: 1.6, 2.0 Oct 13, 2022
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
…andas-dev#48965)

* DOC: Fixed documentation for pivot_table margins (pandas-dev#48916)

The documentation for the margins parameter of pivot_table
was incorrect. It said that the parameter added rows and columns,
but it actually passed them to aggfunc. I used the documentation
from the user guide to replace the old documentation, as well as
added a sentence to the documentation for aggfunc that explained
its role in calculating margins.

* Update pandas/core/frame.py

Co-authored-by: Matthew Roeschke <[email protected]>

Co-authored-by: Matthew Roeschke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants