title: Efficient way to convert numpy matrix into a nested dictionary
body: <p>I have a NumPy2d array that is a symmetric matrix (square matrix where the numbers above the diagonal are the same as the number below the diagonal)</p>
  
  <p>Example input matrix:</p>
  
  <pre><code>edgeMatrix = np.array([[0., 2., 9.],
                         [2., 0., 1.],
                         [9., 1., 0.]])
  </code></pre>
  
  <p>I am looking for a very efficient way to convert this large matrix into a nested dictionary where the first key is the row index of the matrix and the second dict key is the column index of the matrix. ex:</p>
  
  <p>Desired resulting nested dict format:</p>
  
  <pre><code>edgeDict[0][0] = 0
  edgeDict[0][1] = 2
  edgeDict[0][2] = 9
  edgeDict[1][0] = 2
  edgeDict[1][1] = 0
  edgeDict[1][2] = 1
  edgeDict[2][0] = 9
  edgeDict[2][1] = 1
  edgeDict[2][2] = 0
  </code></pre>
  
  <p>I have tried using <code>dict(enumerate(edgeMatrix.flatten(), 1))</code>, but failed to figure out how to get the nested aspect of this working.</p>