pandas to dictionary one column as key another as value code example Example: pandas to dictionary df.to_dict('records')