To test this, I would sort the frame by the column that a chose to create the rank from in ascending order and verify that the ranks are also increasing.
Example:
Let this table be a frame:
(Using denseRank) We rank the table by age into 3 groups. We obtain this:
(Verification step) Then, by sorting the table by age in ascending order, we can see that the column "Age Rank" is also sorted in ascending order:
(From this stackoverflow question: https://stackoverflow.com/questions/46009911/how-to-perform-ranking-as-in-sas-or-a-dense-rank-as-in-sql-in-deedle )
This is my custom implementation, but I don't know if it is the most efficient implementation: