Suppose I have the following numpy.ndarray:
array([[50, 0, 0],
[ 0, 3, 47],
[ 0, 36, 14]])
How is is possible to convert it to a dictionary of this form:
{0: {0: 50}, 1: {1: 3, 2: 47}, 2: {1: 36, 2: 14}}
The question is similar to python 2d array to dict but I cannot work out a solution similar to the answer there no matter how hard I've tried.
{i: {j: value}}