list_ = [1, -4, 0, 10, 7] rank = [sorted(list_, reverse=True).index(i) for i in list_] print(rank) # [2, 4, 3, 0, 1]