Closed scott-griffiths closed 3 weeks ago
So instead of just counting how many zeros or ones, allow bs.count(x) which is roughly equivalent to len(bs.findall(x)).
bs.count(x)
len(bs.findall(x))
There is now a count in bitarray that can be efficiently used. It probably makes sense to allow a bytealigned parameter too.
count
bytealigned
I'm not sure this is really a useful addition, so closing.
So instead of just counting how many zeros or ones, allow
bs.count(x)
which is roughly equivalent tolen(bs.findall(x))
.There is now a
count
in bitarray that can be efficiently used. It probably makes sense to allow abytealigned
parameter too.