pandas 1.4.2

ParametersRaisesReturns
_get_label_or_level_values(self, key: 'str', axis: 'int' = 0) -> 'np.ndarray'

Retrieval logic:

  • (axis=0): Return column values if :None:None:`key` matches a column label. Otherwise return index level values if :None:None:`key` matches an index level.

  • (axis=1): Return row values if :None:None:`key` matches an index label. Otherwise return column level values if 'key' matches a column level

Parameters

key : str

Label or level name.

axis : int, default 0

Axis that levels are associated with (0 for index, 1 for columns)

Raises

KeyError

if :None:None:`key` matches neither a label nor a level

ValueError

if :None:None:`key` matches multiple labels

FutureWarning

if :None:None:`key` is ambiguous. This will become an ambiguity error in a future version

Returns

values : np.ndarray

Return a 1-D array of values associated with :None:None:`key`, a label or level from the given :None:None:`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/generic.py#1796
type: <class 'function'>
Commit: