CellNetwork.cells_where_predicate
- CellNetwork.cells_where_predicate(predicate, data=False)[source]
Get cells for which a certain condition or set of conditions is true using a lambda function.
- Parameters:
- predicatecallable
The condition you want to evaluate. The callable takes 2 parameters: the cell identifier and the cell attributes, and should return True or False.
- databool, optional
If True, yield the cell attributes in addition to the identifiers.
- Yields:
- int | tuple[int, dict[str, Any]]
If data is False, the next cell that matches the condition. If data is True, the next cell and its attributes.