Shared.get_node_label

Shared.get_node_label(nodes, vectorize: bool = False)[source]

Map indices in nodes to node labels.

Parameters
nodesint or array_like

Node indices to map to node labels.

vectorizebool, default=False

Whether to vectorize over nodes (must be ndarray). Better performance for larger arrays.

Returns
str, list or ndarray

Node label(s).

str : If nodes is int.

ndarray : If nodes is ndarray and vectorize is True.

list of str : else.

Raises
ValueError:

Nodes is neither int, ndarray or iterable.