Graph.edges_where

Graph.edges_where(conditions=None, data=False, **kwargs)[source]

Get edges for which a certain condition or set of conditions is true.

Parameters:
conditionsdict, optional

A set of conditions in the form of key-value pairs. The keys should be attribute names. The values can be attribute values or ranges of attribute values in the form of min/max pairs.

databool, optional

If True, yield the edge attributes in addition to the edge identifiers.

**kwargsdict[str, Any], optional

Additional conditions provided as named function arguments.

Yields:
tuple[hashable, hashable] | tuple[tuple[hashable, hashable], dict[str, Any]]

If data is False, the next edge identifier (u, v). If data is True, the next edge identifier and its attributes as a ((u, v), attr) tuple.