#NEWLINE# def test_pivot_complex_aggfunc( self ) : #NEWLINE# #INDENT# f = { #NEWLINE# #INDENT# 'D' : [ 'std' ] , #NEWLINE# 'E' : [ 'sum' ] , #NEWLINE# #UNINDENT# } #NEWLINE# expected = self . data . groupby ( [ 'A' , 'B' ] ) . agg ( f ) . unstack ( 'B' ) #NEWLINE# result = self . data . pivot_table ( index = 'A' , columns = 'B' , aggfunc = f ) #NEWLINE# tm . assert_frame_equal ( self , expected )