The rank of every element of values, without reordering it. ranks(i) is the rank of
values(i), so this is a per-element answer rather than a permutation.
method= chooses how ties are handled, matched case-insensitively:
| token | ranks of 10, 20, 20, 30 |
|---|---|
"competition" (the default) |
1, 2, 2, 4 |
"dense" |
1, 2, 2, 3 |
"ordinal" |
1, 2, 3, 4 |
A null gets rank 0, which is why this takes descending but NOT nulls_first: a
null has no rank at all, so there is no position for nulls_first to choose. NaNs are
ranked as ordinary values (all tying with each other), unlike nulls.
"ordinal" ranks are exactly the inverse of pf_argsort's permutation.