Network.edge_attributes

Network.edge_attributes(key, names=None, values=None)[source]

Get or set multiple attributes of an edge.

Parameters:
keytuple[hashable, hashable]

The identifier of the edge.

nameslist[str], optional

A list of attribute names.

valueslist[Any], optional

A list of attribute values.

Returns:
dict[str, Any] | list[Any] | None

If the parameter names is empty, a dictionary of all attribute name-value pairs of the edge. If the parameter names is not empty, a list of the values corresponding to the provided names. None if the function is used as a “setter”.

Raises:
KeyError

If the edge does not exist.