O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Calculating the rank of values

Ranking helps us determine whether one of two items is ranked higher or ranked lower than another. Ranking reduces measures into a sequence of ordinal numbers that can be used to evaluate complex criteria bask on the resulting order.

To demonstrate ranking, we will use the following series of data:

These values can then be ranked using .rank(), which by default tells us the ordering of the labels from lowest value to highest value:

The result represents the order of the values numerically from smallest to largest ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required