make dictionary from two dataframe columns code example
Example 1: dictionary from two columns pandas
pd.Series(df.A.values,index=df.B).to_dict()
Example 2: pandas create dataframe from multiple dictionaries
sales = [{'account': 'Jones LLC', 'Jan': 150, 'Feb': 200, 'Mar': 140},
{'account': 'Alpha Co', 'Jan': 200, 'Feb': 210, 'Mar': 215},
{'account': 'Blue Inc', 'Jan': 50, 'Feb': 90, 'Mar': 95 }]
df = pd.DataFrame(sales)