How do I split a list into equally-sized chunks?

How do I split a list into equally-sized chunks?

The Python Oracle

54 года назад

5 Просмотров

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Magic Ocean Looping

--

Chapters
00:00 Question
00:39 Accepted answer (Score 4267)
01:37 Answer 2 (Score 657)
01:55 Answer 3 (Score 400)
02:20 Answer 4 (Score 344)
03:35 Thank you

--

Full question
https://stackoverflow.com/questions/312443/how-do-i-split-a-list-into-equally-sized-chunks

Question links:
[How to iterate over a list in chunks]: https://stackoverflow.com/q/434287
[Split string every nth character?]: https://stackoverflow.com/questions/9475241

Answer 2 links:
[numpy.array_split]: https://docs.scipy.org/doc/numpy/reference/generated/numpy.array_split.html

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/licensing

--

Tags
#python #list #split #chunks

#avk47

Тэги:

#avk47 #chunks #list #python #split
Ссылки и html тэги не поддерживаются


Комментарии: