convert pandas dataframe `df` to a dictionary using `id` field as the key,df.set_index('id').to_dict()