title: Perfoming a conditional statement on a GROUPED data frame in pandas using jupyter notebook
body: <p>I get the following error:</p>
  
  <p>TypeError: ‘>=’ not supported between instances of ‘SeriesGroupBy’ and ‘int’</p>
  
  <p>when I perform a conditional on a column of a GROUPED data frame.  </p>
  
  <pre><code>       group_school_data["reading_score"] &gt;=70 
  </code></pre>
  
  <p>I do not have this problem when I use the same syntax on a regular data frame (non-grouped). So when I type:</p>
  
  <pre><code>       school_data_complete["reading_score"] &gt;=70
  </code></pre>
  
  <p>I get a filtered list that performed a boolean and made all instances of 'reading score' >= 70 to 'True'.  Which I can sum up.</p>
  
  <p>However, the 'group_school_data' is a grouped data frame performed on the 'school_data_complete' by grouping the dataframe by school name as follow:</p>
  
  <pre><code>     group_school_data = school_data_complete.groupby(["school_name"])
  </code></pre>
  
  <ol>
  <li><p>When I searched Stackoverflow, I did not find any hints. The most popular response shows how to create a grouped data frame based on an if condition, which is not what I am looking for.</p></li>
  <li><p>I also watched the syntax that was suggested in the following instructional video for a non-grouped data frame, but I get the same error message. <a href="https://www.youtube.com/watch?v=wJhdZfuO2ZA" rel="nofollow noreferrer">https://www.youtube.com/watch?v=wJhdZfuO2ZA</a></p></li>
  </ol>
  
  <p>My code works for a regular data frame and returns a series.</p>
  
  <pre><code>       school_data_complete["reading_score"] &gt;=70
  </code></pre>
  
  <p>But does not work for a grouped data frame</p>
  
  <pre><code>       group_school_data["reading_score"] &gt;=70 
  </code></pre>
  
  <p>and returns:</p>
  
  <p>TypeError: ‘>=’ not supported between instances of ‘SeriesGroupBy’ and ‘int’</p>
  
  <p>'group_school_data' is a grouped data frame performed on the 'school_data_complete' by grouping the dataframe by school as follow:</p>
  
  <pre><code>    group_school_data = school_data_complete.groupby(["school_name"])
  </code></pre>
  
  <p>and the grouping returned a data frame using .head()</p>
  
  <p>I expect to get a list or series when I perform the same on a grouped data frame but I get</p>
  
  <hr>
  
  <p>TypeError                                 Traceback (most recent call last)
   in 
  ----> 1 group_school_data["math_score"] >= 70</p>
  
  <p>TypeError: '>=' not supported between instances of 'SeriesGroupBy' and 'int'</p>