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 and attr and should return True or False.

  • data (bool, optional) – Yield the nodes and their data attributes. Default is False.

Yields

tuple – The next edge identifier (u, v), if data is False. Otherwise, the next edge identifier and its attributes as a ((u, v), attr) tuple.

Examples

>>>