I have the following Dictionary:dict = {('one','A'):8,('one','B'):19,('one','D'):29,('two','C'):18,('two','A'):10,('two','B'):4,('two','D'):2,('six','C'):4,('six','A'):4,('six','B'):4}
I convert it to dataFrame looking like:
Score
one A 8
B 19
D 29
two C 18
A 10
B 4
D 2
six C 4
A 4
B 4
However I want to convert the dictionary to DF, where Key1 from tuple is the index, and key2 is the column names:
A B C D
one 8 19 0 29
two 10 4 18 2
six 4 4 4 0
How can I covert the dictionary to such data frame?
Try this: