title: How to determine that negative values are imutable when using a lookup table in numpy
body: <p>I'm using a lookup table to replace the values of my matrix <code>b</code> according to an <code>a</code> array. My data is populated with a negative value (-9999) to represent "no data" for my final analysis. Because of the inverted index, my output matrix is not what I was expecting (see out: -9999 turns to 22). Is there any way to determine that the negative value remains imutable? If I only use positive values, the code works fine, but that's not my case =/. Thanks in advance!!</p>
  
  <pre><code>a = np.asarray([[1, 11], [2, 22], [3, 33], [10000, 555]], dtype=np.int32)
  b = np.asarray([[0, 1, 2, 3, -9999], [0, 1, 2, 10000, -9999], [0, 1, 2, 3, -9999], [0, 1, 2, 3, -9999]])
  lut = np.arange(b.max()+1) #look up table
  #creating equation to result in output
  k,v = a.T
  lut[k] = v
  out_matrix = lut[b]
  </code></pre>
  
  <p>outputs:</p>
  
  <pre><code>ref table...
  [[    1    11]
   [    2    22]
   [    3    33]
   [10000   555]]
  
  lookup table...
  [    0     1     2 ...,  9998  9999 10000] 
  
  matrix to change...
  [[    0     1     2     3 -9999]
   [    0     1     2 10000 -9999]
   [    0     1     2     3 -9999]
   [    0     1     2     3 -9999]]
  
  out_matrix...
  [[  0  11  22  33  22]
   [  0  11  22 555  22]
   [  0  11  22  33  22]
   [  0  11  22  33  22]]
  </code></pre>