Сделать dict, где ключом будет tuple из первых двух столбцов, а значение - set из строк. Очень хорошо подойдет dict.get((route,car), set())
ЗЫ. ну как-то так
dataset = [
["route1","car1","alex"],
["route1","car1","boris"],
["route2","car1","alex"],
["route2","car1","boris"],
["route1","car1","john"],
["route3","car2","alex"],
["route1","car2","alex"],
["route1","car3","alex"],
["route1","car2","alex"],
["route1","car2","alex"],
["route3","car1","alex"],
]
outdataset = {}
for route,car,driver in dataset:
key = (route,car)
_d = outdataset.get(key,set())
_d.add(driver)
outdataset[key] = _d
for route,car in outdataset.keys():
print(route,car,", ".join(outdataset[(route,car)]))
route1 car1 john, alex, boris
route2 car1 alex, boris
route3 car2 alex
route1 car2 alex
route1 car3 alex
route3 car1 alex