pandas.DataFrame.to_dict

DataFrame.to_dict(outtype='dict')

Convert DataFrame to dictionary.

outtype : str {‘dict’, ‘list’, ‘series’}
Determines the type of the values of the dictionary. The default dict is a nested dictionary {column -> {index -> value}}. list returns {column -> list(values)}. series returns {column -> Series(values)}. Abbreviations are allowed.

result : dict like {column -> {index -> value}}