I intend to get the dictionary with the column name as the key from the data frame.
Suppose I have a dataframe:
a b
0 ac dc
1 ddd fdf
I want the result to be as follows:
{a : ac, b : dc}
I want this to be done line by line. Any help would be greatly appreciated. Here I want the column name to be the key in the resulting dictionary.
source
share