Assume the next dictionary is given:
{(0, 0): 1, (1, 1): 12, (2, 2): 802, (3, 3): 1687, (4, 4): 11, (5, 4): 4, (6, 5): 593, (7, 4): 4}
In the dictionary above each key displays a point in the matrix (x, y) and a value displays the value found in the matrix. How could I construct an array that will contain the values located at each point x, y?
According to the dictionary above the expected result is:
array([[ 1, 0, 0, 0, 0, 0],
[ 0, 12, 0, 0, 0, 0],
[ 0, 0, 802, 0, 0, 0],
[ 0, 0, 0, 1687, 0, 0],
[ 0, 0, 0, 0, 11, 0],
[ 0, 0, 0, 0, 4, 0],
[ 0, 0, 0, 0, 0, 593],
[ 0, 0, 0, 0, 4, 0]])