pandas select in a dict keys by value code example Example: pandas to dictionary df.to_dict('records')