dict to on column data frame code example Example: convert pandas dataframe to dict with a column as key df.set_index('columnName').T.to_dict()