Python Forum
is there an itertor of chunks?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
is there an itertor of chunks?
#9
(Jul-22-2022, 04:06 PM)deanhystad Wrote: None of the itertools do what you want, but at the bottom of the page there are recipes that show how to use itertools to make other tools. grouper does not do what you want, but sliding_window does.
for a step interval of 1 it looks like it can do that. but what if i want a step interval of N? oh wait, selecting every Nth item of the returned list would be that for a step interval of N. let's see, now, how to slice an interval of N.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
is there an itertor of chunks? - by Skaperen - Jul-19-2022, 04:11 AM
RE: is there an itertor of chunks? - by ndc85430 - Jul-19-2022, 04:45 AM
RE: is there an itertor of chunks? - by buran - Jul-19-2022, 05:09 AM
RE: is there an itertor of chunks? - by Pedroski55 - Jul-19-2022, 09:06 AM
RE: is there an itertor of chunks? - by deanhystad - Jul-19-2022, 01:28 PM
RE: is there an itertor of chunks? - by perfringo - Jul-20-2022, 05:49 AM
RE: is there an itertor of chunks? - by Skaperen - Jul-21-2022, 10:40 PM
RE: is there an itertor of chunks? - by deanhystad - Jul-22-2022, 04:06 PM
RE: is there an itertor of chunks? - by Skaperen - Jul-22-2022, 10:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Sad How to split a String from Text Input into 40 char chunks? lastyle 7 1,218 Aug-01-2023, 09:36 AM
Last Post: Pedroski55
  How to scan huge files and make it in chunks ampai 2 2,635 May-28-2020, 08:20 PM
Last Post: micseydel
  how to divide one big equation entered as a string to small chunks gungurbuz 1 1,645 May-28-2020, 03:46 PM
Last Post: Larz60+
  Calling chunks of code The_Taco_King3 3 3,991 Jan-26-2017, 02:54 PM
Last Post: iFunKtion

Forum Jump:

User Panel Messages

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