I have a large dataset of item code and component each item code correlate with component and further component become item code of another component. how can I make a nested dictionary in python
item code component
a q
b w
c r
d t
e y
q u
q v
desired output:-
{a:{q:[u,v]},b:w,c:r etc}
How can I achieve this nested dictionary in python, I have large data
I used defaultdict but it gave me only a dictionary not a nested dictionary