partial rank.py