SyntaxFix
Write A Post
Hire A Developer
Questions
Convert your array y to list l and then do l.count(1) and l.count(0)
y
l
l.count(1)
l.count(0)
>>> y = numpy.array([0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1]) >>> l = list(y) >>> l.count(1) 4 >>> l.count(0) 8