Created
October 16, 2022 15:49
-
-
Save galenseilis/25902234d9422f5d70ec2db3a5619f68 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def convert_range(value, r1, r2 ): | |
| return (value - r1[0]) * (r2[1] - r2[0]) / (r1[1] - r1[0]) + r2[0] | |
| if __name__ == '__main__': | |
| print(convert_range(328.17,[300.77,559.22 ],[1,10])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment