make one column a dictionary code example
Example 1: dataframe to dictionary with one column as key
pd.Series(df.A.values,index=df.B).to_dict()
Example 2: pandas to dictionary
df.to_dict('records')
pd.Series(df.A.values,index=df.B).to_dict()
df.to_dict('records')