level = operator.itemgetter(1)
player = operator.itemgetter(0)
players = sorted(enumerate(players), key=level)
groups = itertools.groupby(players, key=level)
result = [list(map(player, group)) for level, group in groups]
How to sort a list by the value of its elements, with the value defined in a different list in Python