title: Setting index using commonly occurring column value as index of the data frame
body: <p>I have a <code>df</code> as follows:</p>
  
  <pre><code>ID  MAHACEB ID  MOROPEX ID  OTX01   ID  MAPOXUB
  A0AVT1  48  A0AVT1  23  A0A0B4J2F0  22  A0AVT1  38
  A0FGR8  35  A0FGR8  19  A0A0U1RRE5  3   A0FGR8  10
  A0JLT2  28  A0JLT2  50  A0A1B0GUS4  10  A0JLT2  56
  A0JNW5  35  A0JNW5  23  A0AV96      71  A0JNW5  26
  A0MZ66  37  A0MZ66  98  A0AVF1      40  A0MZ66  21
  A0PJW6  48  A0PJW6  27  A0AVT1      12  A0PJW6  29
  </code></pre>
  
  <p>I wanted to use the ID as an index if it's value is common across all columns, or fill with NA for the columns with missing ID values. </p>
  
  <p>I tried the following one liner:</p>
  
  <pre><code>df = df.drop_duplicates(subset='ID', keep='first').set_index('ID')
  </code></pre>
  
  <p>It results in making a list of values in <code>ID</code> as row values.</p>
  
  <p>At the end, I would like to have a dataframe which looks like this:
  With <code>ID</code> as index and all other columns as columns. Fill the missing values filled with <code>NA</code>. </p>
  
  <p>In other words,  if the <code>ID</code> is common accross the columns, then fill the value in otherwise fill with <code>NA</code></p>
  
  <pre><code>ID          MAHACEB MOROPEX OTX01   MAPOXUB
      A0AVT1  48  23  NA  38
  A0A0B4J2F0  NA  NA  22  NA
  A0A0U1RRE5  NA  NA  33  NA
  A0A1B0GUS4  NA  NA  10  NA
      A0FGR8  35  19  NA  10
      A0JLT2  28  50  NA  56
      A0JNW5  35  23  NA  26
      A0AV96  NA  NA  71  NA
      A0MZ66  37  98  NA  21
      A0AVF1  NA  NA  40  NA
      A0PJW6  48  27  NA  29
      A0AVT1  NA  NA  12  NA
  </code></pre>