title: keep all rows in group when a row contains a specified substring pandas
body: <p>I've got data that looks like this:</p>
  
  <pre><code>    ID#     DATE        TEXT
      1       1/1/2017    ENTERED BY A
      1       1/1/2017    BLAH BLAH BLAH
      1       1/2/2017    ENTERED BY B
      1       1/2/2017    BLAH BLAH BLAH
      1       1/2/2017    BLAH BLAH BLAH
      2       1/4/2017    SUPPLEMENTAL PAYMENT BY A
      2       1/4/2017    BLAH BLAH BLAH
      3       1/1/2017    ENTERED BY C
      3       1/2/2017    CHANGED COMPANY NAME
      3       1/2/2017    BLAH BLAH BLAH
  </code></pre>
  
  <p>I'm trying to group the data by ID# and DATE and return all rows when a group (in this I'm grouping on case ID# and DATE) has a text match. </p>
  
  <p>Here's what I've got so far. The code below is attempting to search each row in the TEXT field for the substring 'ENTERED BY' and return all rows associated with that group.</p>
  
  <pre><code>    notes[notes.groupby('ID#','DATE',as_index=False).apply(lambda x: x['TEXT'].str.contains('ENTERED BY'))]
  </code></pre>
  
  <p>I've also tried variations of group.filter() with similar results. Anybody that can point me in the right direction? My output set should look like this:</p>
  
  <pre><code>    ID#     DATE        TEXT
      1       1/1/2017    ENTERED BY A
      1       1/1/2017    BLAH BLAH BLAH
      1       1/2/2017    ENTERED BY B
      1       1/2/2017    BLAH BLAH BLAH
      1       1/2/2017    BLAH BLAH BLAH
      3       1/1/2017    ENTERED BY C
  </code></pre>
  
  <p>Thanks!</p>