I have a dictionary with values in list. But I want to change them from list to a normal dict value.
So it's looking like this:
{1: {'A': { 1: [5], 16: [5], 17: [4],
20: [9], 22: [5], 26: [4],
33: [2], 34: [4], 42: [2],
47: [4], 72: [4], 80: [2]}}}
And this is the expected output: (removing the square brackets)
{1: {'A': { 1: 5, 16: 5, 17: 4,
20: 9, 22: 5, 26: 4,
33: 2, 34: 4, 42: 2,
47: 4, 72: 4, 80: 2}}}
These are like extracts from my actual data, which roughly looks like this. So there's a set of these data in each of the dicts (which is like 3*3=9 in total)
{1: {"A": {}, "B": {}, "C":{}},
2: {"A": {}, "B": {}, "C":{}},
3: {"A": {}, "B": {}, "C":{}}}
I see a lot other questions turning a list into a value in dict. But I'm trying to do the opposite (changing my values to normal values instead of being in a list)
Would be great if you've seen other threads with similar problems and can direct me to them.