create a dictionary from two pandas columns python code example
Example 1: pandas to dictionary
df.to_dict('records')
Example 2: convert pandas group to dict
res = dict(tuple(d.groupby('a')))
df.to_dict('records')
res = dict(tuple(d.groupby('a')))