I have two lists and I want to sort the one of them (scores
) in reverse order and get the corresponding indexes in order to sort the second one (section_id
).
For example:
section_id = [5, 6, 8, 14]
scores = [4, 11, 13, 7]
The new lists will be:
sorted_reverse_scores = [13, 11, 7, 4]
sorted_section_id = [8, 6, 14, 5]
Do you know how to achieve this?
Currently the only thing I do is:
sorted_reverse_scores = section_id.sort(reverse=True)