Skip to content

DOC: improved pivot_table(..) aggfunc parameter explanation #18718

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 4 commits into from
Dec 12, 2017
Merged

DOC: improved pivot_table(..) aggfunc parameter explanation #18718

merged 4 commits into from
Dec 12, 2017

Conversation

stefansimik
Copy link

@stefansimik stefansimik commented Dec 10, 2017

@pep8speaks
Copy link

pep8speaks commented Dec 10, 2017

Hello @stefansimik! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on December 12, 2017 at 11:15 Hours UTC

@jreback jreback added Docs Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Dec 10, 2017
@codecov
Copy link

codecov bot commented Dec 10, 2017

Codecov Report

Merging #18718 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18718      +/-   ##
==========================================
- Coverage   91.58%   91.57%   -0.02%     
==========================================
  Files         153      153              
  Lines       51305    51307       +2     
==========================================
- Hits        46989    46982       -7     
- Misses       4316     4325       +9
Flag Coverage Δ
#multiple 89.43% <ø> (-0.01%) ⬇️
#single 40.71% <ø> (-0.1%) ⬇️
Impacted Files Coverage Δ
pandas/core/frame.py 97.81% <ø> (-0.1%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/io/pytables.py 92.84% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c1f507...1cc42d3. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 10, 2017

Codecov Report

Merging #18718 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18718      +/-   ##
==========================================
+ Coverage   91.58%   91.59%   +<.01%     
==========================================
  Files         153      153              
  Lines       51305    51364      +59     
==========================================
+ Hits        46989    47047      +58     
- Misses       4316     4317       +1
Flag Coverage Δ
#multiple 89.45% <ø> (+0.02%) ⬆️
#single 40.74% <ø> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/frame.py 97.81% <ø> (-0.1%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/io/parquet.py 60.19% <0%> (-5.2%) ⬇️
pandas/io/parsers.py 95.55% <0%> (-0.01%) ⬇️
pandas/core/indexes/interval.py 93.8% <0%> (ø) ⬆️
pandas/core/generic.py 95.9% <0%> (ø) ⬆️
pandas/tseries/offsets.py 96.95% <0%> (ø) ⬆️
pandas/core/indexes/base.py 96.43% <0%> (ø) ⬆️
pandas/io/pytables.py 92.84% <0%> (ø) ⬆️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c1f507...68c0ff2. Read the comment docs.

@jreback jreback added this to the 0.22.0 milestone Dec 12, 2017
@jreback
Copy link
Contributor

jreback commented Dec 12, 2017

lgtm. @jorisvandenbossche

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comments, for the rest looks good!

>>> table = pivot_table(df, values='D', index=['A', 'B'],
... columns=['C'], aggfunc=np.sum)
>>> table
... # doctest: +NORMALIZE_WHITESPACE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove this line (as we currently don't doctest our docstrings yet)

@@ -4413,10 +4413,12 @@ def pivot(self, index=None, columns=None, values=None):
list can contain any of the other types (except list).
Keys to group by on the pivot table column. If an array is passed,
it is being used as the same manner as column values.
aggfunc : function or list of functions, default numpy.mean
aggfunc : function or list of functions or dict, default numpy.mean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'function or list of ..' -> 'function, list of ...'

@stefansimik
Copy link
Author

@jorisvandenbossche
Thank you for comments. PR updated.

... 'E': [min, max, np.mean]})
>>> table
... # doctest: +NORMALIZE_WHITESPACE
D E
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, done.

@stefansimik
Copy link
Author

@jreback @jorisvandenbossche
PR should be fully OK now.

@jorisvandenbossche jorisvandenbossche changed the title Issue #18712: Doc improved: pivot_table(..) & aggfunc parameter DOC: improved pivot_table(..) aggfunc parameter explanation Dec 12, 2017
@jorisvandenbossche jorisvandenbossche merged commit d2fd22e into pandas-dev:master Dec 12, 2017
@jorisvandenbossche
Copy link
Member

@stefansimik Yes, thanks!

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.

DOC: pivot_table - fix documentation of aggfunc parameter
4 participants