Suppose I want to initialize 6 lists of 21 numbers each in a dynamic way, how do I do it?
Like,
temporal_id1 = [0, 1, 2, ...., 20]
temporal_id2 = [21, 22, 23, ...., 42]
. .
. .
. .
temporal_id6 = [105, 106, ...., 125]
What I am doing is a static way. Something like this:
temporal_id1 = []
for i in range(0,21):
temporal_id1.append(i)
temporal_id2 = []
for i in range(21, 42):
temporal_id2.append(i)
temporal_id3 = []
for i in range(42, 63):
temporal_id3.append(i)
temporal_id4 = []
for i in range(63, 84):
temporal_id4.append(i)
temporal_id5 = []
for i in range(84, 105):
temporal_id5.append(i)
temporal_id6 = []
for i in range(105, 126):
temporal_id6.append(i)
But, this is very naive. And I'm dealing with big data where I have to initialize 107 arrays with 4117 items in each of them.
What I figured is something like this:
for i in range (0, 6):
initialize list temporal_i with values (21 * i , 21 * (i+1)) ------ (?)
I just want to know what statement I should write in the (?) line.