#NEWLINE# def aggregate( self , dimensions , function , **kwargs ) : #NEWLINE# #INDENT# '\n        Allows aggregating.\n        ' #NEWLINE# rows = [ ] #NEWLINE# grouped = ( self . groupby ( dimensions ) if len ( dimensions ) else HoloMap ( { #NEWLINE# #INDENT# ( ) : self , #NEWLINE# #UNINDENT# } , kdims = [ ] ) ) #NEWLINE# for ( k , group ) in grouped . data . items ( ) : #NEWLINE# #INDENT# reduced = [ ] #NEWLINE# for vdim in self . vdims : #NEWLINE# #INDENT# data = group [ vdim . name ] #NEWLINE# if isinstance ( function , np . ufunc ) : #NEWLINE# #INDENT# reduced . append ( function . reduce ( data , ** kwargs ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# reduced . append ( function ( data , ** kwargs ) ) #NEWLINE# #UNINDENT# #UNINDENT# rows . append ( ( k , tuple ( reduced ) ) ) #NEWLINE# #UNINDENT# return self . clone ( rows , kdims = grouped . kdims )