pandas 1.4.2

NotesParametersReturns
get_group_index(labels, shape: 'Shape', sort: 'bool', xnull: 'bool') -> 'npt.NDArray[np.int64]'

Notes

The length of :None:None:`labels` and :None:None:`shape` must be identical.

Parameters

labels : sequence of arrays

Integers identifying levels at each location

shape : tuple[int, ...]

Number of unique levels at each location

sort : bool

If the ranks of returned ids should match lexical ranks of labels

xnull : bool

If true nulls are excluded. i.e. -1 values in the labels are passed through.

Returns

An array of type int64 where two elements are equal if their corresponding
labels are equal at all location.

For the particular label_list, gets the offsets into the hypothetical list representing the totally ordered cartesian product of all possible label combinations, as long as this space fits within int64 bounds; otherwise, though group indices identify unique combinations of labels, they cannot be deconstructed. - If sort , rank of returned ids preserve lexical ranks of labels. i.e. returned id's can be used to do lexical sort on labels; - If :None:None:`xnull` nulls (-1 labels) are passed through.

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#100
type: <class 'function'>
Commit: