Say I have the following array:
x = np.array([3,7,1,2,6])
What is the simplest way to obtain the array with its scale say in the inverse way? So the minimum value would become the maximum, the maximum would become the minimum, and so on for the rest of the values.
Expected ouput:
array[3,1,7,6,2]
To clarify on what I want to obtain, say my original sequence is:
y = sorted(x)
#[1, 2, 3, 6, 7]
So the array sorted. If this was the case, the array that I would want is the array reversed, so [7, 6, 3, 2, 1]
. I want to accomplish this with my current input.
Therefore, where I had the lowest value, 1
is now a 7
, the second lowest vaule, 2
is now a 6
, and so on.
x*-1
. apart from that I don't understand how this could be a good thing – d_kennetz Dec 26 '18 at 19:417
should become the lowest,1
, the second largest should become the second lowerst,2
and so on – yatu Dec 26 '18 at 19:44