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>you could iterate through groups doing this with dask, maybe there is a better way but this works for me.</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 group in pdf['B'].unique():
    print groups.get_group(group)
</code></pre>

<p>this would return</p>

<pre><code>dd.DataFrame&lt;dataframe-groupby-get_group-e3ebb5d5a6a8001da9bb7653fface4c1, divisions=(0, 2, 4, 4)&gt;
dd.DataFrame&lt;dataframe-groupby-get_group-022502413b236592cf7d54b2dccf10a9, divisions=(0, 2, 4, 4)&gt;
</code></pre>

python pandas dask