title: Python lambda functions in Dataframe query
body: <p>I have a DataFrame with the following format (not the full size):</p>
  
  <pre><code>    +------------+------+-------+-------+-------+-----+
      |    Date    | Type |  T0   |  T1   |  T2   | ... |
      +------------+------+-------+-------+-------+-----+
      | 2017-01-05 | GBP  | 0.001 | 0.005 | 0.006 |     |
      | 2017-01-05 | USD  | 0.001 | 0.005 | 0.006 |     |
      | 2017-01-05 | EUR  | 0.001 | 0.005 | 0.006 |     |
      | 2017-01-05 | YAN  | 0.001 | 0.005 | 0.006 |     |
      | 2017-01-05 | ZBR  | 0.001 | 0.005 | 0.006 |     |
      | 2017-01-06 | GBP  | 0.001 | 0.005 | 0.006 |     |
      | 2017-01-06 | USD  | 0.001 | 0.005 | 0.006 |     |
      | .......... | ...  |...... |       |       |     |
      +------------+------+-------+-------+-------+-----+
  </code></pre>
  
  <p>Essentially I'm trying to filter this for the dates that are inbetween two specified and the Type equal to USD and GBP. I can currently do this for the date filter but not the Type filter:</p>
  
  <pre><code>df = df[(df.Date &lt;= EndDate) &amp; (df.Date &gt;= StartDate)]
  </code></pre>
  
  <p>I can't seem to figure out how to filter for the Types I need (because it requires an "or" and not "&amp;").</p>
  
  <p>Furthermore I'd like to know how to do all this in one line. I have seen others do something similar using lambda but can't quite understand how all that works. </p>
  
  <p>Can anyone help with the query and explain how I can achieve the same with a Lambda example?</p>
  
  <p>Thanks</p>