title: Python Group By Filtering For Specific Rows Based on a Value
body: <p>I have a data frame that grouped by certain keys. Now my goal is to select specific rows within each group based on a value for a given column</p>
  
  <pre class="lang-py prettyprint-override"><code>df_data.groupby([df_data.index, 'symbol']).filter(lambda x: x['Rank'] == 7)
  </code></pre>
  
  <p>I would have expected rows that meet this condition, however I get an error message saying "filter function returned a Series, but expected a scalar bool"</p>
  
  <p>Trying a bit different (after google search) - </p>
  
  <pre class="lang-py prettyprint-override"><code>df_sql.groupby([df_sql.index, 'symbol']).filter(lambda x: (x['Rank'] == 7).all())
  
  </code></pre>
  
  <p>I now get Empty DataFrame, while I knows it should not be empty.</p>
  
  <p>Any help with some explanation would be highly appreciated.</p>