I am trying to get a rank of worst case scenarios but there are two different types of worst case scenarios that I am trying to compare. So I have two separate arrays and I am trying to compare them to one another.
I used the sorting method from the link below and it works when sorting with one array but not with two.
Rank items in an array using Python/NumPy, without sorting array twice
CI_SUM_1 = numpy.array([2,1,7,23])
CI_SUM_2 = numpy.array([4,0,22,3])
order = CI_SUM_1.argsort() + CI_SUM_2.argsort()
rank = order.argsort()
print(rank)
In the above example it is adding the ranks together(which makes sense), so I am getting [0,2,1,3]
. Which isn't what I am looking for. I am trying to get 8 ranks so I can see individual ranks.
Expected result should be something like [2,1,5,7,4,0,6,3]
which is the ranks when putting the two arrays side by side. Basically what I want is an absolute rank not a rank per array. So I only want one 1 unless the two values are the same. I don't want two arrays from 0-3, I want one from 0-7.