https://pandas.pydata.org/docs/reference/api/pandas.Series.rank.html#pandas.Series.rank
Series.rank(self: ~ FrameOrSeries, axis=0, method: str = 'average', numeric_only: Union[bool, NoneType] = None, na_option: str = 'keep', ascending: bool = True, pct: bool = False)
参数 | 描述 |
---|---|
axis | {0 or ‘index’, 1 or ‘columns’}, default 0 |
method | {‘average’, ‘min’, ‘max’, ‘first’, ‘dense’}, default ‘average’ |
numeric_only | bool, optional |
na_option | {‘keep’, ‘top’, ‘bottom’}, default ‘keep’ |
ascending | bool, default True |
pct | bool, default False |
method参数
average
默认,并列第一,会算一二名的平均数1.5,下一位是第三名
max
两个人并列第二,下一位是第三名
min
两个人并列第一,下一位是第三名
first
并列的两人,不同名词(常用)
dense
,下一个是第三名