In [4]:
grouped = df.groupby('foo')
for name,group in grouped:
    print(name)
    print(group)
one
   foo bar  baz  qux quux
0  one   A    1    6    a
1  one   B    2    5    b
2  one   C    3    4    b
two
   foo bar  baz  qux quux
3  two   A    4    3    c
4  two   B    5    2    c
5  two   C    6    1    c

For DataFrames explicitly specify a column as the filter criterion.

In [6]:
df.groupby('bar').sum()
Out[6]:
baz qux
bar
A 5 9
B 7 7
C 9 5
In [7]:
df.groupby('bar').filter(lambda x: x['baz'].sum() == 5)
Out[7]:
foo bar baz qux quux
0 one A 1 6 a
3 two A 4 3 c

Return the items that have two rows.

In [8]:
df.groupby('quux').groups
Out[8]:
{'a': [0], 'b': [1, 2], 'c': [3, 4, 5]}
In [9]:
df.groupby('quux').filter(lambda x: len(x) == 2)
Out[9]:
foo bar baz qux quux
1 one B 2 5 b
2 one C 3 4 b