pandas.DataFrame.to_dict — pandas 1.3.5 documentation
pandas.pydata.org › pandaspandas.DataFrame.to_dict ¶ DataFrame.to_dict(orient='dict', into=<class 'dict'>) [source] ¶ Convert the DataFrame to a dictionary. The type of the key-value pairs can be customized with the parameters (see below). Parameters orientstr {‘dict’, ‘list’, ‘series’, ‘split’, ‘records’, ‘index’} Determines the type of the values of the dictionary.