I have a numpy array that contains 813698 rows:
len(df_numpy)
Out[55]: 813698
I want to loop through this array using mini batches of 5000.
mini_batch = 5000
i = 0
for each batch in df_numpy:
mysubset = df_numpy[i:mini_batch+i]
# …
i = i + mini_batch
The problem is that (len(df_numpy)-1)/mini_batch is not an integer. So, the last mini batch is not equal to 5000.
How can I loop though df_numpy so that all records of df_numpy are included?
mysubsetin the for loop. Then I perform some operations on eachmysubset.