pandas 1.4.2

ParametersReturns
lexsort_indexer(keys, orders=None, na_position: 'str' = 'last', key: 'Callable | None' = None) -> 'npt.NDArray[np.intp]'

Parameters

keys : sequence of arrays

Sequence of ndarrays to be sorted by the indexer

orders : bool or list of booleans, optional

Determines the sorting order for each element in keys. If a list, it must be the same length as keys. This determines whether the corresponding element in keys should be sorted in ascending (True) or descending (False) order. if bool, applied to all elements as above. if None, defaults to True.

na_position : {'first', 'last'}, default 'last'

Determines placement of NA elements in the sorted list ("last" or "first")

key : Callable, optional

Callable key function applied to every element in keys before sorting

versionadded

Returns

np.ndarray[np.intp]

Performs lexical sorting on a set of keys

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/sorting.py#285
type: <class 'function'>
Commit: