I wish to turn the following dictionary into a matrix where the first and second values of the dictionary are the column and row values. Where the matrix is true I want there to be a '1' and when it is false I want a '0'.
{0: [2, 5.0], 1: [6, 7.0], 2: [6, 8.0], 3: [5, 6.0], 4: [1, 5.0], 5: [3, 4.0], 6: [4, 5.0]}
The desired output would look something like this
1 2 3 4 5 6 7 8
1 0 0 0 0 1 0 0 0
2 0 0 0 0 1 0 0 0
3 0 0 0 1 0 0 0 0
4 0 0 1 0 1 0 0 0
5 1 1 0 1 0 1 0 0
6 0 0 0 0 1 0 1 1
7 0 0 0 0 0 1 0 0
8 0 0 0 0 0 1 0 0
Thanks heaps, any pointers would be awesome!
Danielle.
0: [2, 5.0],supposed to be0: [2, 5, 0], where the last value specifyies True or False? Why is one matrix index anintand the other afloat?