pandas dataframe dict to two columns code example Example: pandas to dictionary df.to_dict('records')