I have a dataframe that looks like his
_____________________
|col1 | col2 | col3 |
---------------------
| a | b | c |
| d | b | c |
| e | f | g |
| h | f | j |
---------------------
I want to get a dictionary structure that looks as follows
{
b : { col1: [a,d], col2: b, col3: c},
f : { col1: [e, h], col2: f, col3: [g, j]}
}
I have seen this answer. But it seems like overkill for what I want to do as it converts every value of the key inside the nested dictionary into a list. I would only like to convert col1 into a list when creating the dictionary. Is this possible?