Another itertool function?

Alex Martelli aleax at aleax.it
Tue Apr 29 08:14:26 EDT 2003


Raymond Hettinger wrote:
   ...
> Here's another idea that was submitted:
> 
> def windowed(iterable, group=2):
>     "returns (i[0], i[1], ... i[group-1]), (i[1], i[2], ... i[group]),

I think this would be perfect if the overlap between successively
returned windows was also a parameter, rather than being fixed to 1.


Alex





More information about the Python-list mailing list