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],
Since numpy-1.13.0, np.unique can be used with axis argument:
numpy-1.13.0
np.unique
axis
>>> np.unique(a, axis=0, return_counts=True) (array([[1, 1, 1], [2, 2, 2], [3, 3, 0]]), array([3, 3, 3]))