EGI.vertices_where_predicate
- EGI.vertices_where_predicate(predicate, data=False)
Get vertices 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:
key
,attr
and should returnTrue
orFalse
.data (bool, optional) – Yield the vertices and their data attributes. Default is
False
.
- Yields
key (hashable) – The next vertex that matches the condition.
2-tuple – The next vertex and its attributes, if
data=True
.
Examples
>>>