title: Map index of numpy matrix
body: <p>How should I map indices of a numpy matrix?</p>
  
  <p>For example:</p>
  
  <pre><code>mx = np.matrix([[5,6,2],[3,3,7],[0,1,6]]
  </code></pre>
  
  <p>The row/column indices are 0, 1, 2.</p>
  
  <p>So:</p>
  
  <pre><code>&gt;&gt;&gt; mx[0,0]
  5
  </code></pre>
  
  <p>Let s say I need to map these indices, converting <code>0, 1, 2</code> into, e.g. <code>10, 'A', 'B'</code> in the way that:</p>
  
  <pre><code>mx[10,10] #returns 5
  mx[10,'A'] #returns 6 and so on..
  </code></pre>
  
  <p>I can just set a <code>dict</code> and use it to access the elements, but I would like to know if it is possible to do something like what I just described.</p>