-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
@@ -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`) |
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.
Could you move this to whatsnew/0.18.2.txt
:)
Could you also add a test ensuring that the margins have the correct names? Thanks. |
Sure thing! Chris Mazzullo
|
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) |
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.
pla compare whole DataFrame
preparing expected output.
Current coverage is 84.32%@@ 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
|
thanks! |
git diff upstream/master | flake8 --diff