title: Drop redundant rows for group in pandas
body: <p>I have the following DataFrame:</p>
  <pre><code>import pandas as pd
  
  data = {'id':  ['A','A','A','A','A','A',
                  'A','A','A','A','A','A',
                  'B','B','B','B','B','B',
                 'C', 'C', 'C', 'C', 'C', 'C',
                 'D', 'D', 'D', 'D', 'D', 'D'],
          'city':['London', 'London','London', 'London', 'London', 'London',
                  'New York', 'New York', 'New York', 'New York', 'New York', 'New York',
                  'Milan', 'Milan','Milan', 'Milan','Milan', 'Milan',
                 'Paris', 'Paris', 'Paris', 'Paris', 'Paris', 'Paris',
                 'Berlin', 'Berlin','Berlin', 'Berlin','Berlin', 'Berlin'],
          'year': [2000,2001, 2002, 2003, 2004, 2005,
                  2000,2001, 2002, 2003, 2004, 2005,
                   2000,2001, 2002, 2003, 2004, 2005,
                  2000,2001, 2002, 2003, 2004, 2005,
                  2000,2001, 2002, 2003, 2004, 2005],
          't': [0,0,0,0,1,0,
                0,0,0,0,0,1,
                0,0,0,0,0,0,
                0,0,1,0,0,0,
               0,0,0,0,1,0]}
  
  df = pd.DataFrame(data)
  </code></pre>
  <p>For each group <code>id</code> - <code>city</code>, I need to drop the rows for those higher years after <code>t=1</code>. For instance, <code>id = A</code> is in London in <code>year=2004</code> (<code>t=1</code>). I want to drop the rows for the group <code>A</code> - <code>London</code> when <code>year=2005</code>. Please note that if an <code>id</code> is never in a city over 2000-2005, I want to keep all the rows (see, for instance, <code>id = B</code> in Milan).</p>
  <p>The desired output:</p>
  <pre><code>import pandas as pd
  
  data = {'id':  ['A','A','A','A','A',
                  'A','A','A','A','A','A',
                  'B','B','B','B','B','B',
                 'C', 'C', 'C',
                 'D', 'D', 'D', 'D', 'D'],
          'city':['London', 'London','London', 'London', 'London',
                  'New York', 'New York', 'New York', 'New York', 'New York', 'New York',
                  'Milan', 'Milan','Milan', 'Milan','Milan', 'Milan',
                 'Paris', 'Paris', 'Paris',
                 'Berlin', 'Berlin','Berlin', 'Berlin','Berlin'],
          'year': [2000,2001, 2002, 2003, 2004,
                  2000,2001, 2002, 2003, 2004, 2005,
                   2000,2001, 2002, 2003, 2004, 2005,
                  2000,2001, 2002,
                  2000,2001, 2002, 2003, 2004],
          't': [0,0,0,0,1,
                0,0,0,0,0,1,
                0,0,0,0,0,0,
                0,0,1,
               0,0,0,0,1]}
  
  df = pd.DataFrame(data)
  </code></pre>