1

I am trying to process only k (10) portions of a list of lists at a time. The problem is that there are remainders (quotient) from dividing by 10 so I want to also process the remaining. Is there an elegant solution to this?

so far here is my code:

for x10 in np.arange(0, len(candidates), 10):
    indexed = enumerate([list(enumerate(entry)) for entry in candidates[[x10-10:x10]]])

Not a duplicate: I dont want to split the list into evenly sized chunks but into multiples of 10

Update: turns out x10:x10+10 did it... thought that would give me out of index error, strange

gdev
  • 25
  • 1
  • 7

0 Answers0