I have the following type of arrays:
a = array([[1,1,1], [1,1,1], [1,1,1], [2,2,2], [2,2,2], [2,2,2],
The numpy_indexed package (disclaimer: I am its author) contains efficient vectorized functionality for these kind of operations:
import numpy_indexed as npi unique_rows, row_count = npi.count(a, axis=0)
Note that this works for arrays of any dimensionality or datatype.