dask.dataframe.DataFrame.to_bag

dask.dataframe.DataFrame.to_bag

DataFrame.to_bag(index=False, format='tuple')[source]

Create Dask Bag from a Dask DataFrame

Parameters
indexbool, optional

If True, the elements are tuples of (index, value), otherwise they’re just the value. Default is False.

format{“tuple”, “dict”, “frame”}, optional

Whether to return a bag of tuples, dictionaries, or dataframe-like objects. Default is “tuple”. If “frame”, the original partitions of df will not be transformed in any way.

Examples

>>> bag = df.to_bag()