Graph.nodes

Graph.nodes(data=False)[source]

Iterate over the nodes of the network.

Parameters

data (bool, optional) – If True, yield the node attributes in addition to the node identifiers.

Yields

hashable | tuple[hashable, dict[str, Any]] – If data is False, the next node identifier. If data is True, the next node as a (key, attr) tuple.