title: How to delete duplicate rows in a pandas dataframe such that only the last entry will be deleted
body: <p>How to delete duplicate rows such that only the last duplicate entry will be deleted. The pandas drop_duplicates func will only keep either the first entry or last entry but I need all the entries except the last one.</p>
  <p>Eg:</p>
  <pre><code>X = pd.DataFrame({&quot;col1&quot;: list('acbcaa')})
  </code></pre>
  <p>Desired output</p>
  <pre><code>X = pd.DataFrame({&quot;col1&quot;: list('acba')})
  </code></pre>