I am trying to rank a column (col 1) in pandas. If there is a tie, I want to look at another column (col 2) 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.
Example:
col1  |  col 2 | Rank
 20   |  3     | 3
 22   |  2     | 2
 22   |  2.5   | 1
 3    |  1     | 4
 3    |  1     | 5
 
    