quantify

sknano.core.quantify(iterable, pred=<class 'bool'>)[source] [edit on github][source]

Count how many times the predicate is true.

Examples

>>> from sknano.core import quantify
>>> quantify([True, False, True])
2