title: How to use an input column as a major index in hierarchical indexing in pandas?
body: <p>My csv file contains columns such as:</p>
  
  <pre><code>col1   col2
  
  1      0.9
  1      0.3
  2      0.4
  2      0.9
  2      0.1
  3      0.0
  4      0.5
  4      0.9
  </code></pre>
  
  <p>And I put this into a data frame, so naturally the df adds an index to all of the rows.<br>
  I want to keep the first column as my major index, and within each major index, have a minor index such as:</p>
  
  <pre><code>ID       col1   col2
  
  1      1        0.9
         2        0.3
  2      1        0.4
         2        0.9
         3        0.1
  3      1        0.0
  4      1        0.5
         2        0.9
  </code></pre>
  
  <p>How do I do this?  </p>
  
  <p>My end goal is to be able to eliminate rows of a certain Major ID.  For example, if the average of the rows in Major ID 4, is below 0.5, then I'll eliminate those rows.  </p>
  
  <p>I assume the best way is to use a major index, but if there's a better way, please let me know.</p>