Python Forum
How do I calculate a ratio from 2 numbers and return an equivalent list of about 1000
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I calculate a ratio from 2 numbers and return an equivalent list of about 1000
#8
By splitting the range between the two numbers into equal intervals and computing the corresponding values, you may compute a ratio between two numbers and generate a list of around 1000 equivalent values.

The two integers in this example that you wish to compute the ratio for are numbers 1 and 2. These two numbers are passed to the calculate_ratio_list function together with the required number of entries (num_values) to be included in the result list. After calculating the ratio, it applies the ratio to the first integer in a geometric progression to get a list of roughly 1000 values.
buran write Jan-05-2024, 07:06 AM:
clickbait link removed
Reply


Messages In This Thread
RE: How do I calculate a ratio from 2 numbers and return an equivalent list of about 1000 - by William_Sewell - Jan-05-2024, 06:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Entry field random pull from list, each return own line Bear1981 6 742 Feb-25-2025, 06:09 AM
Last Post: Pedroski55
  python code to calculate mean of an array of numbers using numpy viren 3 1,172 May-29-2024, 04:49 PM
Last Post: Gribouillis
  what to return for an empty list Skaperen 2 1,149 May-24-2024, 05:17 PM
Last Post: Skaperen
  find random numbers that are = to the first 2 number of a list. Frankduc 23 7,028 Apr-05-2023, 07:36 PM
Last Post: Frankduc
  List of random numbers astral_travel 17 5,629 Dec-02-2022, 10:37 PM
Last Post: deanhystad
  Remove numbers from a list menator01 4 3,637 Nov-13-2022, 01:27 AM
Last Post: menator01
  [split] why can't i create a list of numbers (ints) with random.randrange() astral_travel 7 2,784 Oct-23-2022, 11:13 PM
Last Post: Pedroski55
  Divide a number by numbers in a list. Wallen 7 10,873 Feb-12-2022, 01:51 PM
Last Post: deanhystad
  Need to parse a list of boolean columns inside a list and return true values Python84 4 3,162 Jan-09-2022, 02:39 AM
Last Post: Python84
  producing numbers out of a list bouraque7878 10 5,693 Nov-12-2021, 09:13 PM
Last Post: jefsummers

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020