-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Explain pivot vs. pivot_table (#6950) #14650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
mroeschke
commented
Nov 14, 2016
- closes ENH/CLN: Make df.pivot to the mapping of pivot_table #6950
Current coverage is 85.28% (diff: 100%)@@ master #14650 diff @@
==========================================
Files 140 140
Lines 50693 50693
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 43235 43234 -1
- Misses 7458 7459 +1
Partials 0 0
|
See also | ||
-------- | ||
DataFrame.pivot : pivot without aggregation that can handle | ||
non-numeric data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a similar reference in pivot
to pivot_table
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pivot
docstring already references pivot_table
(here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, that's good. But not yet the pd.pivot
one, and that is apparently located here: https://github.com/pandas-dev/pandas/blob/master/pandas/core/reshape.py#L339
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thank you for bringing that to my attention. I'll push that change later tonight.
@@ -90,6 +90,11 @@ You of course can then select subsets from the pivoted DataFrame: | |||
Note that this returns a view on the underlying data in the case where the data | |||
are homogeneously-typed. | |||
|
|||
While ``pivot`` provides general purpose pivoting of DataFrames with various | |||
data types (strings, numerics, etc.), Pandas also provides the ``pivot_table`` | |||
function for pivoting with aggregation of numeric data (see the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would love this down to the first paragraph in the pivot section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good @jreback. I'll push the change later tonight.
Move pivot paragraph to pivot table section add pivot_table reference to pivot
@jorisvandenbossche @jreback Thanks for the feedback. Implemented the changes you guys suggested. |
@mroeschke Thanks a lot! (feel free to do more PRs with doc improvements :-)) |