I'm looking for the shortest possible way to uniformly scale a float array like
orig_arr = [0.0, 0.2, 0.4, 0.6, 0.8]
to another range where 0.0 from this example is transformed to min and 0.8 is transformed to max.
Usually I'd do this by calculating componentwise:
new_arr[i] = new_rg_min + orig_arr[i] * (new_rg_max - new_rg_min)
But if there's some numpy or whatever function that can do this without the need of a loop...
or shorter: I'd like to linearly scale and move one range to another.