Skip to main content

Modify the range of collection of numbers on scale of log5 for better visualization. It works best between 0-100. max,min is the max and min value from the present list and, a and b are the max and min values you want. It will set values between a and b. Then convert it to the scale of log5

Project description

Modify Range of numbers

Modify the range of collection of numbers on scale of log5 for better visualization. It works best between 0-100. max,min are the max and min value from the present list and, a and b are the max and min values you want of the new range. It is then converted into logarithmic scale.

Run the following to install:

pip install modify_range

Is based on the formula:

f(x) = (b-a)(x-min)/(max-min)      

To convert:

from modify_range import change_range
...
...
x = change_range(x,min,max,a,b)

Here,

  • x = integer from the list
  • min = min value from the list
  • max = max value from the list
  • a = new maximum value
  • b = new minimum value

To get back the values: (not recommended to use, as original values are lost while converting to logarithmic scale. Exact values cannot be obtained)

x = inverse_range(x,min,max,a,b)

Here,

  • x = integer value from the modified list
  • max = maximum integer value from the modified list
  • min = minimum integer value from the modified list
  • a = max value from the original list
  • b = min value from the original list

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modify_range-0.0.2.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

modify_range-0.0.2-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page