how to convert columns to dictionary python code example Example: pandas to dictionary df.to_dict('records')