Python Forum
How do I split a large array into smaller sub-arrays?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I split a large array into smaller sub-arrays?
#1
Hi,

I was wondering how I could split a large array into smaller chunks?

For example:

arr = ["hello", "my", "name", "is", "name", "hello", "my", "name", "is", "name2", "hello", "my", "name", "is", "name3"]
And I want to split the array into:
arr2 = [["hello", "my", "name", "is", "name"], ["hello", "my", "name", "is", "name2"], "hello", "my", "name", "is", "name3"]
If someone could please help, I would gladly appreciate it.
Thanks!
Reply


Messages In This Thread
How do I split a large array into smaller sub-arrays? - by codebeacon - Apr-07-2019, 02:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Passing parameters with arrays and array definitions michael_lwt 1 952 Jul-07-2022, 09:45 PM
Last Post: Larz60+
  numpy.dot() result different with classic computation for large-size arrays geekgeek 5 1,903 Jan-25-2022, 09:45 PM
Last Post: Gribouillis
  splitting UAV/sat images to smaller pieces in order to feed a CNN hobbyist 0 1,538 Dec-08-2020, 11:48 AM
Last Post: hobbyist
  Split dict of lists into smaller dicts of lists. pcs3rd 3 2,387 Sep-19-2020, 09:12 AM
Last Post: ibreeden
  Splitting the audio file into smaller packets before transfer using UDP protocol in p MuhammadAli152 0 3,739 May-15-2020, 03:01 PM
Last Post: MuhammadAli152
  'Get closest value array in array of arrays.' follow up help. DreamingInsanity 10 7,311 Dec-05-2019, 06:30 PM
Last Post: DreamingInsanity
  Get closest value array for array of arrays. DreamingInsanity 2 2,359 Nov-18-2019, 03:55 PM
Last Post: DreamingInsanity

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020