title: How to get matching row indices from a pandas query?
body: <p>Applying a pandas query essentially returns a dataframe that matches the query. I am wondering how one can also retrieve the raw matching row indices (alternatively boolean array)? In particular for dataframes that do have a custom index and therefore do not allow the raw indices to be extracted from the dataframe itself.</p>
  <pre><code>    Col1
  R1     4
  R2     5
  R3     6
  R4     7
  </code></pre>
  <p>df.query(&quot;Col1 &gt; 5&quot;) returns</p>
  <pre><code>    Col1
  R3     6
  R4     7
  </code></pre>
  <p>The desired output are however the corresponding row indices = [2,3]</p>
  <p>Is there any chance to easily retrieve the raw indices with a query without using a secondary compare step?</p>