Network.nodes

Network.nodes(data=False)[source]

Iterate over the nodes of the network.

Parameters:
databool, 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.