October 2019
Beginner to intermediate
674 pages
16h 43m
English
The rank() function returns a DataFrame with the rank of each value that was estimated along the specified axis. Ranking takes place in ascending order by default:
sales_df.rank()
The following is the output:

The rank() method can be applied as shown here:
sales_df.rank(ascending = False)
The following is the output:

Ranking can also be obtained as a percentage, as shown here:
sales_df.rank(pct = True)
The following is the output:
The method() ...
Read now
Unlock full access