from functools import reduce
reduce(lambda lst, item: lst + [(item[0], item[1], sum(map(lambda i: i[1],
    lst)))], [(key, len(list(it))) for key, it in itertools.groupby(
    list_one)], [])
How to get the index and occurance of each item using itertools.groupby()