title: How to compare two dataframes and delete the non matched rows from dataframes in Pandas?
body: <p>I am a newbie to python (especially pandas).</p>
  
  <p>I have two dataframes df1 &amp; df2. df1 has 200 rows. df2 has 250 rows. The index values also contains duplicates. </p>
  
  <pre><code>df1:
  ProcessID
        248
        436
        500
        500
  </code></pre>
  
  <p>Another data frame</p>
  
  <pre><code>ProcessID   Day      Time     Status
        248   Sun  23:26:51  completed
        436   Sat  01:50:56  completed
        500   Thu  14:18:21  completed
        500   Wed  23:00:15  Completed
  </code></pre>
  
  <p>I wanted to know how to compare both dataframes in pandas based on the processID (which is the index in both df's). Based on the comparison I wanted to remove the excess rows in df2.</p>
  
  <p>It will be of great help if someone can guide me.</p>