a is not the list of indices. a is the old values and b is the new values; think of them as keys and values of a mapping dictionary.
for example all 0 (second element of a) in c should be mapped to 5 (second element of b).
if a,b and c were regular lists:
my_dict = dict(zip(a, b))
d = map(my_dict.get, c)

sorry if my explanation was not clear enough.