iterate over GroupBy object in dask
<p>Is it possible, to iterate over a dask GroupBy object to get access to the underlying dataframes? I tried:</p>

<pre><code>import dask.dataframe as dd
import pandas as pd
pdf = pd.DataFrame({'A':[1,2,3,4,5], 'B':['1','1','a','a','a']})
ddf = dd.from_pandas(pdf, npartitions = 3)
groups = ddf.groupby('B')
for name, df in groups:
    print(name)
</code></pre>

<p>However, this results in an error: <code>KeyError: 'Column not found: 0'</code></p>

<p>More generally speaking, what kind of interactions does the dask GroupBy object allow, except from the apply method?</p>

<p>Generally iterating over Dask.dataframe objects is not recommended.  It is inefficient.  Instead you might want to try constructing a function and mapping that function over the resulting groups using <code>groupby.apply</code></p>

python pandas dask