pandas 0.8.0 documentation

pandas.DataFrame.to_dict

DataFrame.to_dict(outtype='dict')

Convert DataFrame to dictionary.

Parameters :

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.

Returns :

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