Reputation: 294
I have a pandas dataframe like :
COL1 VALUE1 VALUE2
A A12 1
B B13 2
A C12 3
B Q12 4
Need a dictionary from the above dataframe where COL1 will be stored as the key and value1 and value2 will be in sub-dict.
eg:-
dict = {'A':{'A12':1, 'C12':3}, B:{'B13':2, 'Q12':4}}
Upvotes: 2
Views: 121