JuliaCollections / IterTools.jl

Common functional iterator patterns
Other
152 stars 28 forks source link

[Feature Request] Sliding Windows #112

Open SyxP opened 11 months ago

SyxP commented 11 months ago

Given a sequence c_1, c_2, ..., c_n, ... which are outputs of a (possibly infinite) iterator. The windows(c, k) should return an iterator with first entry [c_1, c_2, ..., c_k], second entry [c_2, c_3, ..., c_{k+1}] and so on.

The name is from a common technique called sliding window, mentioned here https://en.cppreference.com/w/cpp/ranges/slide_view .

oxinabox commented 11 months ago

MLDataUtils.jl provides these btw. in a variety of varieties