pandas.core.groupby.GroupBy.rank

Provide the rank of values within each group.

param method
{‘average’, ‘min’, ‘max’, ‘first’, ‘dense’}, default ‘average’
  • average: average rank of group

  • min: lowest rank in group

  • max: highest rank in group

  • first: ranks assigned in order they appear in the array

  • dense: like ‘min’, but rank always increases by 1 between groups

param ascending
boolean, default True

False for ranks by high (1) to low (N)

param na_option
{‘keep’, ‘top’, ‘bottom’}, default ‘keep’
  • keep: leave NA values where they are

  • top: smallest rank if ascending

  • bottom: smallest rank if descending

param pct
boolean, default False

Compute percentage rank of data within each group

param axis
int, default 0

The axis of the object over which to compute the rank.

return

DataFrame with ranking of values within each group

Warning

This feature is currently unsupported by Intel Scalable Dataframe Compiler