(self, other)
return result
Subtract count, but keep only results with positive counts.

        >>> Counter('abbbc') - Counter('bccd')
        Counter({'b': 2, 'a': 1})
Subtract count, but keep only results with positive counts.
Subtract count but keep only results with positive counts .
def __sub__(self, other):
        ''' Subtract count, but keep only results with positive counts.

        >>> Counter('abbbc') - Counter('bccd')
        Counter({'b': 2, 'a': 1})

        '''
        if not isinstance(other, Counter):
            return NotImplemented
        result = Counter()
        for elem, count in self.items():
            newcount = count - other[elem]
            if newcount > 0:
                result[elem] = newcount
        for elem, count in other.items():
            if elem not in self and count < 0:
                result[elem] = 0 - count
        return result
def __sub__ ( self , other ) : if not isinstance ( other , Counter ) : return NotImplemented result = Counter ( ) for elem , count in self . items ( ) : newcount = count - other [ elem ] if newcount > 0 : result [ elem ] = newcount for elem , count in other . items ( ) : if elem not in self and count < 0 : result [ elem ] = 0 - count return result