You can use collections.Counter :
>>> import numpy as np >>> a = np.array([[ 0, 1, 2, 4, 5, 1, 2, 3], ... [ 4, 5, 6, 8, 9, 5, 6, 7], ... [ 8, 9, 10, 12, 13, 9, 10, 11]]) >>> from collections import Counter >>> Counter(map(tuple, aT)) Counter({(2, 6, 10): 2, (1, 5, 9): 2, (4, 8, 12): 1, (5, 9, 13): 1, (3, 7, 11): 1, (0, 4, 8): 1})