How to "squish" a range of numbers to the same spread between 0 and 1 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?

You're asking for a function $f$, defined on some closed interval $\left[m, M\right]$, with values is $\left[0, 1\right]$, with the property that:
$$\frac{f(x)}{f(y)} = \frac{x}{y}$$
for all $x < y$ in said interval.
From this specification, we can derive a property the function must have. Fix $y$ to any non-zero value for which $f(y) \neq 0$, and let $x$ stay variable:
$$\frac{f(x)}{f(y)} = \frac{x}{y} \Rightarrow f(x) = \frac{f(y)}{y} x = \text{constant} \times x$$
So any such function must be of the form $f(x) = c x$. Bringing in the requirement that $f(m) = 0$:
$$
0 = f(m) = c m
$$
So either $c$ or $m$ must be zero. We can't have $c = 0$, since then everything collapses, so it must be the case that $m = 0$.
Therefore, such a function exists only when $m = 0$. In this case, such a function is easy to construct: $f(x) = \frac{x}{M}$.
