pandas create dictionary using row elements as key code example
Example 1: dataframe to dict without index
df.to_dict('index')
Example 2: pandas to dictionary
df.to_dict('records')
df.to_dict('index')
df.to_dict('records')