So I have a range of numbers that I need to "squish" into values between 0 and 1 - where lowest value is zero and the highest is 1. I need preserve the ratio.
For instance. If I had these example arrays (all the same ratio between each other):
0, 2000, 8000, 10000
0, 4000, 16000, 20000
0, 200000, 800000, 1000000
I'm hoping to get back a result something like this for each of those individual arrays:
0, 0.2, 0.8, 1
Notice that the ratio between the numbers is preserved.
Is there a built in function somewhere (in
numpy?) that does this for me?