title: Expressing pandas subset using pipe
body: <p>I have a dataframe that I subset like this:</p>
  
  <pre><code>   a  b   x  y
  0  1  2   3 -1
  1  2  4   6 -2
  2  3  6   6 -3
  3  4  8   3 -4
  
  df = df[(df.a &gt;= 2) &amp; (df.b &lt;= 8)]
  df = df.groupby(df.x).mean()
  </code></pre>
  
  <p>How do I express this using the pandas pipe operator?</p>
  
  <pre><code>df = (df
        .pipe((x.a &gt; 2) &amp; (x.b &lt; 6)
        .groupby(df.x)
        .apply(lambda x: x.mean())
  </code></pre>