from numpy import unique, array, all

def myunique(input):
    u = array([array(x) for x in set(tuple(x) for x in input)])
return u, array([len(input[all(input == x, axis=1)]) for x in u], dtype=int)
Extract unique rows from a matrix in numpy with the frequency of each row that was created