b = [45, 42, 0, 1, -1, 0]
print(zip(*sorted(zip(sorted(b), sorted(enumerate(a), key=lambda x: x[1])),
    key=lambda x: x[1][0]))[0])
print(list(zip(*sorted(zip(sorted(b), sorted(enumerate(a), key=lambda x: x[
    1])), key=lambda x: x[1][0])))[0])
Putting a list in the same order as another list