dask.bag.Bag.filter

dask.bag.Bag.filter

Bag.filter(predicate)[source]

Filter elements in collection by a predicate function.

>>> def iseven(x):
...     return x % 2 == 0
>>> import dask.bag as db
>>> b = db.from_sequence(range(5))
>>> list(b.filter(iseven))
[0, 2, 4]