Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to construct a dictionary of dictionaries from a list

Given the matrix [0,1,2] [1,0,3] [1,2,4] [0,2,3] [2,4,1] [2,3,2] how to obtain the dictionary D={0:{1:2,2:3},1:{0:3,2:4},2:{3:2,4:1}} ?