I have two sets of data in the below code that are linked - 5 'networks', and 5 singular results through 'TT' values. Each TT value corresponds to a network set (e.g. TT1=100 is a result from network1).
My goal is to be able to rank the 5 networks based on the TT results.
network1 = [0,1,0,0,0,0,1,0,0,0,1,1,0,0,1]
network2 = [0,1,0,0,0,0,0,0,1,0,1,1,0,0,1]
network3 = [0,1,0,0,0,0,0,1,0,0,1,1,0,0,1]
network4 = [0,1,0,0,0,0,0,0,0,0,1,1,0,1,1]
network5 = [0,1,1,0,0,0,0,0,0,0,1,1,0,0,1]
networks = [network1, network2, network3, network4, network5]
TT1 = 100
TT2 = 70
TT3 = 80
TT4 = 105
TT5 = 120
TTranks = [TT1,TT2,TT3,TT4,TT5]
s = {x: i for i, x in enumerate(sorted(set(TTranks)))}
ranks = [s[x] for x in TTranks]
print(ranks)
The results below from this process rank the TT values only, although I am unsure how to link it so that the corresponding networks are also ranked appropriately.
[2, 0, 1, 3, 4]
That is, I would like it to then rank the 5 networks as network2, network3, network1, network4, network5. This will be very useful as I would like to be able to call from the ordered network results later on.
Additionally, is there a more effective way of completing this process?
I appreciate all the help!!