I've been trying to sort a list of names alphabetically, let's say:
list=['Bob','Alice','Charlie']
print(list.index('Alice'))
1
However I'd also like to keep track of the original indexes, so this won't work:
list.sort()
print(list)
['Alice','Bob','Charlie']
print(list.index('Alice'))
0
After sorting the indexes changed; is there any way of keeping track of the original indexes? I've checked other similar questions and numpy has a solution, but not useful for str variables.