The original train set shows each individual ticket with its features. Yet the goal of the competition is to predict a number of tickets for a given ride. So we need to aggregate the tickets. I share my repo (https://github.com/pawelmorawiecki/traffic_jam_Nairobi), where you can download such the aggregated train set and see the code which generates a new csv file.
nice, i did mine using defaultdict. My repo (https://github.com/hakymulla/Zindi-Dataset)