Skip to content

Commit fa0b4c2

Browse files
committed
BUG: GH15420 - _rank private method on Categorical
1 parent 9a6b5cd commit fa0b4c2

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

pandas/core/algorithms.py

+21-21
Original file line numberDiff line numberDiff line change
@@ -598,27 +598,27 @@ def mode(values):
598598
def rank(values, axis=0, method='average', na_option='keep',
599599
ascending=True, pct=False):
600600
"""
601-
Rank the values along a given axis.
602-
603-
Parameters
604-
----------
605-
values : array-like
606-
Array whose values will be ranked. The number of dimensions in this
607-
array must not exceed 2.
608-
axis : int, default 0
609-
Axis over which to perform rankings.
610-
method : {'average', 'min', 'max', 'first', 'dense'}, default 'average'
611-
The method by which tiebreaks are broken during the ranking.
612-
na_option : {'keep', 'top'}, default 'keep'
613-
The method by which NaNs are placed in the ranking.
614-
- ``keep``: rank each NaN value with a NaN ranking
615-
- ``top``: replace each NaN with either +/- inf so that they
616-
there are ranked at the top
617-
ascending : boolean, default True
618-
Whether or not the elements should be ranked in ascending order.
619-
pct : boolean, default False
620-
Whether or not to the display the returned rankings in integer form
621-
(e.g. 1, 2, 3) or in percentile form (e.g. 0.333..., 0.666..., 1).
601+
Rank the values along a given axis.
602+
603+
Parameters
604+
----------
605+
values : array-like
606+
Array whose values will be ranked. The number of dimensions in this
607+
array must not exceed 2.
608+
axis : int, default 0
609+
Axis over which to perform rankings.
610+
method : {'average', 'min', 'max', 'first', 'dense'}, default 'average'
611+
The method by which tiebreaks are broken during the ranking.
612+
na_option : {'keep', 'top'}, default 'keep'
613+
The method by which NaNs are placed in the ranking.
614+
- ``keep``: rank each NaN value with a NaN ranking
615+
- ``top``: replace each NaN with either +/- inf so that they
616+
there are ranked at the top
617+
ascending : boolean, default True
618+
Whether or not the elements should be ranked in ascending order.
619+
pct : boolean, default False
620+
Whether or not to the display the returned rankings in integer form
621+
(e.g. 1, 2, 3) or in percentile form (e.g. 0.333..., 0.666..., 1).
622622
"""
623623
if is_categorical(values):
624624
ranks = values._rank(axis=axis, method=method, ascending=ascending,

0 commit comments

Comments
 (0)