generate an interval-based array of numbers in python
December 10th, 2007 by Lawrence David
let’s say you want to make an array of all the numbers between 5 and 7, separated by the interval 0.33 in python. one way to do that would be:
min = 5.0
max = 7.0
interval = 0.33
my_list = [min + val*interval for val in range(int((max-min)/interval))]