title: How to work with duplicate entries in Pandas Data Frame?
body: <p>I have a df with the following entries</p>
  
  <pre><code>ID            FIRST_NAME    FIRST_SUBJECT     SECOND_SUBJECT
  A2035559    Sometsdf        Science
  A2035559    Sometsdf        ENGINEERING
  A20340619   Nsdsjes         MATHS
  A20340619   Nsdsjes         SCIENCE
  </code></pre>
  
  <p>I want to identify the duplicate row by the column 'ID' and delete the duplicate row, but move the 'FIRST_SUBJECT' from the deleted row to the 'SECOND_SUBJECT' column of the original row. So that I have this.</p>
  
  <pre><code>ID            FIRST_NAME    FIRST_SUBJECT     SECOND_SUBJECT
  A2035559    Sometsdf        Science            ENGINEERING
  A20340619   Nsdsjes         MATHS              SCIENCE
  </code></pre>
  
  <p>This seems very tricky to me, I started by trying to sort the dataFrame by 'ID' but all my ID's start with 'A', so that did not work. How do I go about achieving this?</p>
  
  <p>I had another idea that I am trying,</p>
  
  <p>I create two copies of the dataFrame, df1 and df2. Since, I have only a maximum of one duplicate (ie. two copies of the same row), I drop duplicates by taking the last and the first in df1 and df2 respectively and then attempt to merge the two.</p>
  
  <pre><code>  df1 = df.drop_duplicates('ID' , take_last=False)
    df2 = df.drop_duplicates('ID' , take_last=True)
  
    df1['SECOND_SUBJECT'] = df2['FIRST_SUBJECT']
  </code></pre>
  
  <p>Would this work?</p>