title: Trouble with "multi-dimensional" dictionary
body: <p>I'm trying to create the following data structure on the fly by reading the output of another script line by line, if certain combinations of thresholds are breached, I want to track those in a dictionary:</p>
  
  <pre><code>data = {}
  
  data[device]['mntpt']   = mntpt
  data[device][timestamp] = { 'r_ops': r_ops, 'r_avgrtt': r_avgrtt, 'r_avgexe': r_avgexe, 'w_ops': w_ops, 'w_avgrtt': w_avgrtt, 'w_avgexe': w_avgexe }
  </code></pre>
  
  <p>For each device, there can be a varying number of timestamps, each containing 6 datapoints. The r_xxx and w_xxx variables are floats. device, mntpt and timestamp are strings.</p>
  
  <p>I'm getting the following error:</p>
  
  <pre><code>TypeError: unsubscriptable object
  </code></pre>
  
  <p>I get the same error if I comment out this line:</p>
  
  <pre><code># data[device]['mntpt']   = mntpt
  </code></pre>
  
  <p>What am I doing wrong here?</p>
  
  <p>Thx</p>