Python Count Occurrences In Numpy Array To Scalar And Functional Processes