marcus-g
5/17/2017 - 8:30 AM

numpy quick counting of collection elements From http://stackoverflow.com/questions/28663856/how-to-count-the-occurrence-of-certain-item-in-

 >>> unique, counts = numpy.unique(a, return_counts=True)
 >>> dict(zip(unique, counts))
 {0: 7, 1: 4, 2: 1, 3: 2, 4: 1}