I am a python newbie here, and I have been struck on a rather simple problem - and I am looking for the most efficient way to solve this. So, I have 5 lists as follows:
a,b,c,d,score
where the above lists all have the same size (500 in my case). a,b,c,d
are string lists and score
is an int
list.
What I would like to do is sort a,b,c,d
based on ascending or descending sorting of score
. So, I would first want to sort score
based on a descending pattern, and then sort the corresponding elements in a,b,c,d
based on the sorted score list (in the same order).
I was thinking of enumerate
to achieve this, but I am wondering if itertools
could be used here to make it faster and more efficient.
Any guidance on how this can be achieved would be much appreciated && sorry if this is a 101 question.