Code to retrieve i, v list:
for i, v in enumerate(Some_array):
print(i, v)
Output
0 -100
1 30
2 -90
3 -80
4 100
5 1000
and so on
Basically we have all the Vs as above 100, 30, -90 and so on. I want to sort the entire i,v in the order of v's from largest to smallest
Expected output
5 1000
4 100
1 30
3 -80
2 -90
0 -100
I want the index values to remain the same. They should not get sorted. Only v values should be sorted. All other answers sort i values too and instead of 5,4,1,3,2,0 we get 0,1,2,3,4,5 as index which I dont want. Expected output is mentioned