pandas dataframe columkn with dictionary to columns code example Example: columns to dictionary pandas pd.Series(df.A.values,index=df.B).to_dict()