#NEWLINE# def combine( self , other , func , fill_value = nan ) : #NEWLINE# #INDENT# '\n        Perform elementwise binary operation on two Series using given function\n        with optional fill value when an index is missing from one Series or\n        the other\n\n        Parameters\n        ----------\n        other : Series or scalar value\n        func : function\n        fill_value : scalar value\n\n        Returns\n        -------\n        result : Series\n        ' #NEWLINE# if isinstance ( other , Series ) : #NEWLINE# #INDENT# new_index = self . index . union ( other . index ) #NEWLINE# new_name = _maybe_match_name ( self , other ) #NEWLINE# new_values = np . empty ( len ( new_index ) , dtype = self . dtype ) #NEWLINE# for ( i , idx ) in enumerate ( new_index ) : #NEWLINE# #INDENT# lv = self . get ( idx , fill_value ) #NEWLINE# rv = other . get ( idx , fill_value ) #NEWLINE# new_values [ i ] = func ( lv , new_index ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# new_index = self . index #NEWLINE# new_values = func ( self . _values , other ) #NEWLINE# new_name = self . name #NEWLINE# #UNINDENT# return self . _constructor ( new_values , index = new_index , name = new_name )