title: UndefinedVariableError when querying pandas DataFrame
body: <p>I am attempting to create a graph by querying values in a pandas <code>DataFrame</code>.</p>
  
  <p>In this line:</p>
  
  <pre><code>data1 = [np.array(df.query('type == i')['continuous']
           for i in ('Type1', 'Type2', 'Type3', 'Type4')]
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>UndefinedVariableError: name 'i' is not defined
  </code></pre>
  
  <p>What am I missing?</p>