#NEWLINE# def merge( self , other ) : #NEWLINE# #INDENT# '\n        Merge the another :class:`EventArray` into this one.\n\n        The :class:`EventArray` objects are concatenated horizontally\n        (column-wise), :func:`np.hstack`).\n\n        If the attributes of the two :class:`EventArray` are not\n        compatible, and Exception is raised.\n        ' #NEWLINE# othertimes = other . times . rescale ( self . times . units ) #NEWLINE# times = ( np . hstack ( [ self . times , othertimes ] ) * self . times . units ) #NEWLINE# labels = np . hstack ( [ self . labels , other . labels ] ) #NEWLINE# kwargs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for name in ( 'name' , 'description' , 'file_origin' ) : #NEWLINE# #INDENT# attr_self = getattr ( self , name ) #NEWLINE# attr_other = getattr ( other , name ) #NEWLINE# if ( attr_self == attr_other ) : #NEWLINE# #INDENT# kwargs [ name ] = attr_self #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# kwargs [ name ] = ( 'merge(%s, %s)' % ( attr_self , attr_other ) ) #NEWLINE# #UNINDENT# #UNINDENT# merged_annotations = merge_annotations ( self . annotations , other . annotations ) #NEWLINE# kwargs . update ( merged_annotations ) #NEWLINE# return EventArray ( times = times , labels = labels , ** kwargs )