I have a really large list of like 3 million elements, say it's
x = [1, 2, 3, 4, 5, 6, ..., 3000000]
and I have tried subtracting a number from it, like 8, (inputting exactly like this: x - 8) and it thankfully gives me another list of the same amount of elements but with 8 subtracted from it Like
[-7, -6, -5, -4, -3, -2, ..., 2999992]
but I have another list, say
otherlist = [1, 2, 3, 4, 5, 6, 7, 8]
where otherlist[7] = 8
and when I try to perform the same subtraction (x - otherlist[7]
) it freaks out on me & can't just give me the same output as before.
How can I approach this problem? I have tried creating a separate list of just
separatelist = [0, 1, 2, ..., 2999999]
for example so I could use it as indices to iterate over my original x list
x[m] - otherlist[7] for m in separatelist
but that has the same issue of not processing.