Given a list of numbers, which can be in any order, such as
3, -5, -1, 2, 7, 12, -8
I would like to produce a list which represents their rank, which in this case would be
4, 1, 2, 3, 5, 6, 0
The numbers are actually some member of an ordered list of classes. Note that the order of the list does not change, they just get counted according to their rank.
(these numbers represent a z-order, but there could be other uses)