dictionary in rows to multiple columns pandas code example Example: dictionary from two columns pandas pd.Series(df.A.values,index=df.B).to_dict()