df
df.groupby('foo').groups
{'one': [0, 1, 2], 'two': [3, 4, 5]}
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
grouped.get_group('one')