title: fast lookup in python
body: <p>I have entries (~88 millions in all) in the following format:</p>
  
  <pre><code>userid  age test    value
  111 33  SODIUM  140
  111 34  POTASSIUM   4.1
  333 65.4    CHLORIDE    107
  444 24  BICARBONATE 24
  </code></pre>
  
  <p>I need to create a fast lookup for the <code>value</code> in last column, given the first three items (ie. <code>userid</code>, <code>age</code>, <code>test</code>). </p>
  
  <p>What is the best way to repeatedly lookup into this data? One that I am thinking of is to create a dictionary in which the <code>keys</code> are the tuple (<code>userid</code>, <code>age</code>, <code>test</code>) and values are <code>value</code>. In the past I used similar method and this method was very slow on much smaller data. </p>