I have these numbers:
- 0.477486
- 0.627644
- 0.763021
- 0.857888
- 0.892062
- 0.857888
- 0.763021
- 0.627644
0.477486
and I want to remap them to a new target domain for example 0 to 10 instead of 0.477486 to 0.892062.
I have these numbers:
0.477486
and I want to remap them to a new target domain for example 0 to 10 instead of 0.477486 to 0.892062.
You can use this method:
>>> l = [0.477486, 0.627644, 0.763021, 0.857888, 0.892062,
0.857888, 0.763021, 0.627644, 0.477486]
>>> print([(i - min(l)) * 10 / (max(l) - min(l)) for i in l])
This should print
[0.0, 3.6219655744664423, 6.887398209254755, 9.17568793176643, 10.0, 9.17568793176643, 6.887398209254755, 3.6219655744664423, 0.0]