turn pandas.core.frame.DataFrame into dictionary code example Example: pandas to dictionary df.to_dict('records')