dask.bag.Bag.frequencies

dask.bag.Bag.frequencies

Bag.frequencies(split_every=None, sort=False)[source]

Count number of occurrences of each distinct element.

>>> import dask.bag as db
>>> b = db.from_sequence(['Alice', 'Bob', 'Alice'])
>>> dict(b.frequencies())       
{'Alice': 2, 'Bob', 1}