Skip to content

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

Merged
merged 1 commit into from
Nov 16, 2016

Conversation

mroeschke
Copy link
Member

@codecov-io
Copy link

codecov-io commented Nov 14, 2016

Current coverage is 85.28% (diff: 100%)

Merging #14650 into master will decrease coverage by <.01%

@@             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          

Powered by Codecov. Last update a7604fc...e98b27d

See also
--------
DataFrame.pivot : pivot without aggregation that can handle
non-numeric data
Copy link
Member

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 ?

Copy link
Member Author

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)

Copy link
Member

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

Copy link
Member Author

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
Copy link
Contributor

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

Copy link
Member Author

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
@mroeschke
Copy link
Member Author

@jorisvandenbossche @jreback Thanks for the feedback. Implemented the changes you guys suggested.

@jorisvandenbossche jorisvandenbossche added this to the 0.20.0 milestone Nov 16, 2016
@jorisvandenbossche jorisvandenbossche merged commit 4814823 into pandas-dev:master Nov 16, 2016
@jorisvandenbossche
Copy link
Member

@mroeschke Thanks a lot! (feel free to do more PRs with doc improvements :-))

@mroeschke mroeschke deleted the fix_6950 branch December 21, 2016 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH/CLN: Make df.pivot to the mapping of pivot_table
4 participants