refactored and moved count_true from df to seq utils
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user