title: Python Sorting Script by Rank
body: <p>I am new to python so apologies for the general nature of this question. I have done a fair amount of research in how to tackle this problem conceptually and would appreciate some advice in what methods to use to move forward.</p>
  
  <p>I am trying to create a loop that will take ~80 students from a csv, each of whom has ranked 8 different professors by choice and in turn sort them into classes by their top choices:</p>
  
  <pre><code>Student 1 = {profA, profC, profH, profD, profE, profB, profG, profF}
  
  Student 2 = {profB, profD, profH, profE, profA, profC, profG, profF}
  
  Student 3 = {profC, profC, profH, profD, profE, profB, profG, profF}
  
  ..... to Student 80
  </code></pre>
  
  <p>and in turn create a list:</p>
  
  <pre><code>ProfA: (Student 1, Student 7, ...)
  ProfB: (Student 2, Student 23, ...)
  ProfC: (Student 3, Student 8, ...)
  </code></pre>
  
  <p>In the end it will need to optimize the rosters so that students can be put into their second and third choices as each professor can only have 10 students. Along with this, is there anyway to ensure a distribution of students getting their top 3 choices through this method?</p>
  
  <p>Once again sorry for the general nature of this question, but any guidance methodology would be helpful.</p>