Logo Search packages:      
Sourcecode: relational version File versions  Download package

def relational::relation::relation::intersection (   self,
  other 
)

Intersection operation. The result will contain items present in both
operands.
Will return an empty one if there are no common items.
Will return None if headers are different.
It is possible to use projection and rename to make headers match.

Definition at line 197 of file relation.py.

00197                                 :
        '''Intersection operation. The result will contain items present in both
        operands.
        Will return an empty one if there are no common items.
        Will return None if headers are different.
        It is possible to use projection and rename to make headers match.'''
        other=self.rearrange(other) #Rearranges attributes' order
        if (self.__class__!=other.__class__)or(self.header!=other.header):
            return None
        newt=relation()
        newt.header=header(list(self.header.attributes))
        
        #Adds only element not in other, duplicating them
        for e in self.content:
            if e in other.content:
                newt.content.append(list(e))
        return newt
    
    def difference(self,other):


Generated by  Doxygen 1.6.0   Back to index