title: How do I create a 'Rank' column in pandas?
body: <p>I am trying to rank a column <code>(col 1)</code> in pandas. If there is a tie, I want to look at another column <code>(col 2)</code> just for those records and do a tie breaker. IF they are same even in that column, I want to just assign the ranks randomly but each row must have a unique rank.</p>
  
  <p>Example:</p>
  
  <pre><code>col1  |  col 2 | Rank
   20   |  3     | 3
   22   |  2     | 2
   22   |  2.5   | 1
   3    |  1     | 4
   3    |  1     | 5
  </code></pre>