@@ -781,13 +781,19 @@ def test_pivot_table_with_iterator_values(self):
781
781
782
782
def test_pivot_table_margins_name_with_aggfunc_list (self ):
783
783
# GH 13354
784
- margins_name = 'Weekly'
785
- costs = pd .DataFrame ({'item' :['bacon' ,'cheese' ,'bacon' ,'cheese' ],
786
- 'cost' :[2.5 ,4.5 ,3.2 ,3.3 ],
787
- 'day' :['M' ,'M' ,'T' ,'T' ]})
788
- table = costs .pivot_table (index = "item" ,columns = "day" ,margins = True ,
789
- margins_name = margins_name ,aggfunc = [np .mean ,max ])
790
- ix = pd .Index (['bacon' , 'cheese' , margins_name ], dtype = 'object' , name = 'item' )
784
+ margins_name = 'Weekly'
785
+ costs = pd .DataFrame (
786
+ {'item' : ['bacon' , 'cheese' , 'bacon' , 'cheese' ],
787
+ 'cost' : [2.5 , 4.5 , 3.2 , 3.3 ],
788
+ 'day' : ['M' , 'M' , 'T' , 'T' ]}
789
+ )
790
+ table = costs .pivot_table (
791
+ index = "item" , columns = "day" , margins = True ,
792
+ margins_name = margins_name , aggfunc = [np .mean , max ]
793
+ )
794
+ ix = pd .Index (
795
+ ['bacon' , 'cheese' , margins_name ], dtype = 'object' , name = 'item'
796
+ )
791
797
tups = [('mean' , 'cost' , 'M' ), ('mean' , 'cost' , 'T' ),
792
798
('mean' , 'cost' , margins_name ), ('max' , 'cost' , 'M' ),
793
799
('max' , 'cost' , 'T' ), ('max' , 'cost' , margins_name )]
0 commit comments