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 3 parameters:
u
,v
,attr
and should returnTrue
orFalse
.data (bool, optional) – Yield the nodes and their data attributes. Default is
False
.
- Yields
2-tuple – The next edge as a (u, v) tuple, if
data=False
.3-tuple – The next edge as a (u, v, data) tuple, if
data=True
.
Examples
>>>