l have a list following
List = [['Dev', 'Jon'], ['Dev', 'Darin'], ['Dev', 'Hans'],
['Test', 'Richard'], ['Test', 'Mike'], ['Test', 'Jon'], ['Test', 'Hans'],
['Chef', 'Bozho'], ['Chef', 'Mike'], ['Chef', 'Jon']] .
I want to calculate how many times every person appear and add his time step by step
for example, the result is following:
[['Dev', 'Jon', 1], ['Dev', 'Darin',1], ['Dev', 'Hans', 1],
['Test', 'Richard', 1], ['Test', 'Mike', 1], ['Test', 'Jon', 2], ['Test', 'Hans', 2],
['Chef', 'Bozho', 1], ['Chef', 'Mike', 2], ['Chef', 'Jon', 3]]
thanks very much 🙂
The solution could be something like this:
We use
Yslist to store counters for all people andZslist to accumulate every person with corresponding index. Hope it helps.