pandas 1.4.2

Parameters
rank(values: 'ArrayLike', axis: 'int' = 0, method: 'str' = 'average', na_option: 'str' = 'keep', ascending: 'bool' = True, pct: 'bool' = False) -> 'npt.NDArray[np.float64]'

Parameters

values : np.ndarray or ExtensionArray

Array whose values will be ranked. The number of dimensions in this array must not exceed 2.

axis : int, default 0

Axis over which to perform rankings.

method : {'average', 'min', 'max', 'first', 'dense'}, default 'average'

The method by which tiebreaks are broken during the ranking.

na_option : {'keep', 'top'}, default 'keep'

The method by which NaNs are placed in the ranking. - keep : rank each NaN value with a NaN ranking - top : replace each NaN with either +/- inf so that they there are ranked at the top

ascending : bool, default True

Whether or not the elements should be ranked in ascending order.

pct : bool, default False

Whether or not to the display the returned rankings in integer form (e.g. 1, 2, 3) or in percentile form (e.g. 0.333..., 0.666..., 1).

Rank the values along a given axis.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/algorithms.py#974
type: <class 'function'>
Commit: