I want to achive a result such that.
For this dataframe:
Name Val
A 1
A 2
B 1
B 3
B 4
I want a dictionary like {'A':[1,2],'B';[1,3,4]}
I will be having two such dataframes and my goal is to achive the difference in value for each key. Like for key 'B' other data frame can have value as 1,5.
I dont want to use loop as dataframe will be huge.
I tried using
df.set_index(key).to_dict()[value-colum]
but this gives me only one value for each key.
I tried to use group by into datafram