divide list into batches numpy code example Example: python split range into n groups import numpy x = range(25) l = numpy.array_split(numpy.array(x),6)