Passing 'records' Parameter To Pandas To_dict Method
I have a dataframe that I'd like to convert to a dictionary. I want each column in the dataframe to be mapped to the values in it. import numpy as np import pandas as pd data =
Solution 1:
Try this:
dict1 = df.to_dict('records')
Post a Comment for "Passing 'records' Parameter To Pandas To_dict Method"