title: Convert nd array to key, value dictionary
body: <p>Is there a function in python to convert an nd-array into a dictionary where key is a tuple of index and value is the matrix value at that index?</p>
  
  <p>For example:</p>
  
  <pre><code>A = np.random.random([3,4,5])
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>{(i,j,k): A[i,j,k]}
  </code></pre>