title: Pandas - Opposite of drop duplicates, keep first
body: <p>I'm familiar with how to drop duplicate rows, and then using the parameter of <code>first</code>, <code>last</code>, <code>none</code>. Nothing too complicated with that and there's plenty of examples (ie <a href="https://stackoverflow.com/questions/23667369/drop-all-duplicate-rows-in-python-pandas">here</a>).</p>
  
  <p>However, what I'm looking for is there a way to find the duplicates, but instead of dropping all duplicates and keeping the first, if I have duplicates, keep all duplicates but drop the first:</p>
  
  <p>So instead of "drop if duplicates, keep the first", I want "keep if duplicates, drop first"</p>
  
  <p>Example:</p>
  
  <p>Given this dataframe, and looking at duplicates in <code>cost</code> column:</p>
  
  <pre><code>    ID name type cost
  0    0    a   bb    1
  1    1    a   cc    2 &lt;--- there are duplicates, so drop this row
  2  1_0    a   dd    2
  3    2    a   ee    3 &lt;--- there are duplicates, so drop this row
  4  2_0    a   ff    3
  5  2_1    a   gg    3
  6  2_2    a   hh    3
  </code></pre>
  
  <p>If there are duplicates in the <code>cost</code> column, just drop the first occurrence, but keep the rest.</p>
  
  <p>So my output would be:</p>
  
  <pre><code>    ID name type cost
  0    0    a   bb    1
  2  1_0    a   dd    2
  4  2_0    a   ff    3
  5  2_1    a   gg    3
  6  2_2    a   hh    3
  </code></pre>
  
  <p>Heres the sample dataframe:</p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame([
  ['0',   'a',    'bb',   '1'],
  ['1',   'a',    'cc',   '2'],
  ['1_0', 'a',    'dd',   '2'],
  ['2',   'a',    'ee',   '3'],
  ['2_0', 'a',    'ff',   '3'],
  ['2_1', 'a',    'gg',   '3'],
  ['2_2', 'a',    'hh',   '3']], columns = ['ID', 'name', 'type', 'cost'])
  </code></pre>