Graph.edges_where_predicate
- Graph.edges_where_predicate(predicate, data=False)[source]
Get edges for which a certain condition or set of conditions is true using a lambda function.
- Parameters
predicate (callable) – The condition you want to evaluate. The callable takes 2 parameters: a key
(u, v)tuple andattrand should returnTrueorFalse.data (bool, optional) – Yield the nodes and their data attributes. Default is
False.
- Yields
tuple – The next edge identifier (u, v), if
dataisFalse. Otherwise, the next edge identifier and its attributes as a ((u, v), attr) tuple.
Examples
>>>