Your code would already do this (i.e. return 8), so I don’t understand this requirement:



 cbd:

I want array of [4,3,1] corresponding to value greater than 0.1 in each batch.


Could you describe it a bit more with an example, if possible?