I have a list as below:
L = [[0,[1,1.0]],
[0,[2,0.5]],
[1,[3,3.0]],
[2,[1,0.33],
[2,[4,1.5]]]
I would like to convert it into a nested dict as below:
D = {0:{1: 1.0,
2: 0.5},
1:{3: 3.0},
2:{1: 0.33,
4: 1.5}
}
I'm not sure how to convert it. Any suggestion? Thank you!