Skip to content

Commit 669931f

Browse files
committed
Added unit test for pivot_table margins_name when aggfunc is a list
1 parent 0dcb78f commit 669931f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tools/tests/test_pivot.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,13 @@ def test_pivot_table_with_iterator_values(self):
779779
)
780780
tm.assert_frame_equal(pivot_values_gen, pivot_values_list)
781781

782+
def test_pivot_table_margins_name_with_aggfunc_list(self):
783+
# GH 13354
784+
margins_name = 'Weekly'
785+
table = self.data.pivot_table(index='A', columns='B', margins=True,
786+
margins_name=margins_name, aggfunc=[np.mean, max])
787+
self.assertEqual(table[:][:].index[2], margins_name)
788+
782789

783790
class TestCrosstab(tm.TestCase):
784791

0 commit comments

Comments
 (0)