refactored and moved count_true from df to seq utils

This commit is contained in:
2020-11-04 15:32:11 +01:00
parent 1d96ec18d8
commit ea2293429e
3 changed files with 9 additions and 8 deletions

View File

@ -1,5 +1,13 @@
import numpy as np
def count_true(seq):
bools = np.asanyarray(seq, dtype=bool)
return np.count_nonzero(bools)
def is_empty(seq):
return len(seq) == 0