Skip to content

BUG: df.pivot_table: margins_name ignored when aggfunc is a list #13435

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

Closed
wants to merge 6 commits into from

Conversation

cmazzullo
Copy link
Contributor

@@ -682,3 +682,4 @@ Bug Fixes
- Bug in ``pd.to_numeric()`` with ``Index`` returns ``np.ndarray``, rather than ``Index`` (:issue:`12777`)
- Bug in ``pd.to_numeric()`` with datetime-like may raise ``TypeError`` (:issue:`12777`)
- Bug in ``pd.to_numeric()`` with scalar raises ``ValueError`` (:issue:`12777`)
- Bug in ``pd.pivot_table()`` where margins_name is ignored when aggfunc is a list (:issue:`13354`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you move this to whatsnew/0.18.2.txt :)

@TomAugspurger
Copy link
Contributor

Could you also add a test ensuring that the margins have the correct names? Thanks.

@TomAugspurger TomAugspurger added the Reshaping Concat, Merge/Join, Stack/Unstack, Explode label Jun 14, 2016
@TomAugspurger TomAugspurger added this to the 0.18.2 milestone Jun 14, 2016
@jreback jreback removed this from the 0.18.2 milestone Jun 14, 2016
@jreback jreback added the Bug label Jun 14, 2016
@cmazzullo
Copy link
Contributor Author

Sure thing!

Chris Mazzullo
On Jun 13, 2016 11:25 PM, "Tom Augspurger" [email protected] wrote:

Could you also add a test ensuring that the margins have the correct
names? Thanks.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#13435 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AF-H8__ES0GttIBx9u98G2eGa8LqbHalks5qLh84gaJpZM4I01I4
.

@jorisvandenbossche jorisvandenbossche added this to the 0.18.2 milestone Jun 16, 2016
margins_name = 'Weekly'
table = self.data.pivot_table(index='A', columns='B', margins=True,
margins_name=margins_name, aggfunc=[np.mean, max])
self.assertEqual(table[:][:].index[2], margins_name)
Copy link
Member

@sinhrks sinhrks Jun 16, 2016

Choose a reason for hiding this comment

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

pla compare whole DataFrame preparing expected output.

@jreback jreback removed this from the 0.18.2 milestone Jun 16, 2016
@codecov-io
Copy link

codecov-io commented Jun 18, 2016

Current coverage is 84.32%

Merging #13435 into master will increase coverage by 0.09%

@@             master     #13435   diff @@
==========================================
  Files           138        138          
  Lines         50805      51072   +267   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          42796      43069   +273   
+ Misses         8009       8003     -6   
  Partials          0          0          

Powered by Codecov. Last updated by 62b4327...6017e25

@jreback jreback added this to the 0.18.2 milestone Jun 18, 2016
@jreback jreback closed this in 35bb1a1 Jun 18, 2016
@jreback
Copy link
Contributor

jreback commented Jun 18, 2016

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: df.pivot_table: margins_name is ignored when there aggfunc is list
6 participants