convert pandas data frame to dictionary code example Example: pandas to dictionary df.to_dict('records')