#NEWLINE# def _apply( self , func , axis = 0 , subset = None , **kwargs ) : #NEWLINE# #INDENT# subset = ( slice ( None ) if ( subset is None ) else subset ) #NEWLINE# subset = _non_reducing_slice ( subset ) #NEWLINE# if ( axis is not None ) : #NEWLINE# #INDENT# result = self . data . loc [ subset ] . apply ( func , axis = axis , ** kwargs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = func ( self . data . loc [ subset ] , ** kwargs ) #NEWLINE# #UNINDENT# self . _update_ctx ( axis ) #NEWLINE# return self