PYTHON CONVERT PANDA DATAFRAME TO DICT code example Example: convert pandas dataframe to dict with a column as key df.set_index('columnName').T.to_dict()