title: How should I use an array (or tuple) as key and values for a Numba typed dictionary?
body: <p>I have the following code that attempts to store a key-value pair into a numba dictionary. The official page of Numba says that the new typed dictionary supports array as the key, but I could not get it to work. 
  The error message says that the key cannot be hash. 
  Any idea how to get this working?</p>
  
  <pre><code>In [7]: from numba.typed import Dict 
     ...: from numba import types 
     ...: import numpy as np        
  
  In [15]: dd = Dict.empty(key_type=types.int32[::1], value_type=types.int32[::1],)                                                                                                                                  
  
  In [16]: key = np.asarray([1,2,3], dtype=np.int32)                                                                                                                                                                 
  
  In [17]: dd[key] = key   
  </code></pre>
  
  <p>Error Message: </p>
  
  <p>TypingError: Failed in nopython mode pipeline (step: nopython frontend)
  Unknown attribute '<strong>hash</strong>' of type array(int32, 1d, C)</p>
  
  <p>EDIT:
  I am probably missing something. I could use types.UniTuple in the interpreter (without the @jit decorator). However, when I put the following function into a script a.py and run it with command "python a.py", I got the UniTuple not found error.</p>
  
  <pre><code>@jit(nopython=True)
  def go_fast2(date, starttime, id, tt, result): # Function is compiled and runs in machine code
      prev_record = Dict.empty(key_type=types.UniTuple(types.int64, 2),  value_type=types.UniTuple(types.int64, 3),)
      for i in range(1, length):
          key = np.asarray([date[i], id[i]], dtype=np.int64)
          thistt = tt[i]
          thistime = starttime[i]
          if key in prev_record:
              prev_time = prev_record[key][0]
              prev_tt = prev_record[key][1]
              prev_res = prev_record[key][2]
              if thistt == prev_tt and thistime - prev_time &lt;= 30 * 1000 * 1000: # with in a 10 seconds window
                  result[i] = prev_res + 1
              else:
                  result[i] = 0
              prev_record[key] = np.asarray((thistime, thistt, result[i]), dtype=np.int64)
          else:
              result[i] = 0
              prev_record[key] = np.asarray((thistime, thistt, result[i]), dtype=np.int64)
      return 
  </code></pre>