(self, **kwargs)
return self.scan(update_frequencies, start={}, **kwargs)
Count occurrences of elements
Count occurrences of elements
Count occurrences of elements
def frequencies(self, **kwargs):
        """ Count occurrences of elements """
        def update_frequencies(last, x):
            return toolz.assoc(last, x, last.get(x, 0) + 1)

        return self.scan(update_frequencies, start={}, **kwargs)
def frequencies ( self , * * kwargs ) : def update_frequencies ( last , x ) : return toolz . assoc ( last , x , last . get ( x , 0 ) + 1 ) return self . scan ( update_frequencies , start = { } , * * kwargs )