dask.bag.Bag.pluck
dask.bag.Bag.pluck¶
- Bag.pluck(key, default='__no__default__')[source]¶
Select item from all tuples/dicts in collection.
>>> import dask.bag as db >>> b = db.from_sequence([{'name': 'Alice', 'credits': [1, 2, 3]}, ... {'name': 'Bob', 'credits': [10, 20]}]) >>> list(b.pluck('name')) ['Alice', 'Bob'] >>> list(b.pluck('credits').pluck(0)) [1, 10]