bigframes.pandas.Series.rank#
- Series.rank(axis=0, method: str = 'average', numeric_only=False, na_option: str = 'keep', ascending: bool = True, pct: bool = False) Series[source]#
Compute numerical data ranks (1 through n) along axis.
By default, equal values are assigned a rank that is the average of the ranks of those values.
- Parameters:
method ({'average', 'min', 'max', 'first', 'dense'}, default 'average') – How to rank the group of records that have the same value (i.e. ties): average: average rank of the group, min: lowest rank in the group max`: highest rank in the group, first: ranks assigned in order they appear in the array, dense: like ‘min’, but rank always increases by 1 between groups.
numeric_only (bool, default False) – For DataFrame objects, rank only numeric columns if set to True.
na_option ({'keep', 'top', 'bottom'}, default 'keep') – How to rank NaN values: keep: assign NaN rank to NaN values, , top: assign lowest rank to NaN values, bottom: assign highest rank to NaN values.
ascending (bool, default True) – Whether or not the elements should be ranked in ascending order.
pct (bool, default False) – Whether or not to display the returned rankings in percentile form.
- Returns:
Return a Series or DataFrame with data ranks as values.
- Return type: