pandas groupby to dictionary code example Example: dict from group pandas dict(tuple(df.groupby('a')))