I want to make a for loop for a calculation task, since the data is too large for one calculation and I always get new data I want to split my calculation process.
My array a
has length n
I want to use the x
first elements for the calculation (c=b*x
) and than the next x
elements of the array. so in total n/x
times to calculate. At the end I want to concate/append all my c -arrays into one array ctotal.
so for an example:
a=np.random.rand(70000000)
ctotal=[]
x=7000
for i in range():
c=model.predict(#each7000 elements of a)
ctotal=ctotal.append(append with c)
#calculate something with 20 first elements of a and return new
#array c, rand append to ctotal, repeat with new 20 elements