old_timestamp = 0
for line in reversed(data):
    timestamp, _, arena = line.split()
if arena == old_arena:
    continue
timestamp = int(timestamp)
try:
    result[old_arena] += old_timestamp - timestamp
except:
    result[old_arena] = old_timestamp - timestamp
old_arena = arena
old_timestamp = timestamp
result[old_arena] += old_timestamp - int(timestamp)
Do I need to iterate through every row of data to calculate time per column category?