data_array = [[0, 0, 1], [1, 1, 1], [1, 1, 1], [1, 0, 1]]
dict_ = {}
for list_, count in itertools.groupby(data_array):
    dict_.update({tuple(list_), len(list(count))})
Efficient way to count unique elements in array in numpy/scipy in Python