You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not really sure of the right words to describe what I'm looking for, so possibly this already exists.
I'd like something that is like zipping an iterator with one or more staggered copies of itself. For example, for a window size of 3, on an iterator over [1, 2, 3, 4, 5], this would yield:
I wanted this for a machine learning application where I'm trying to predict the next element of a sequence given the previous N elements. Perhaps this is also useful for other purposes, but I'm not sure that it is.
I have implemented a proof-of-concept. Although the code could be improved in many ways, I think it's correct. If this would be an interesting addition to itertools, I'd be happy to refine these implementations to fix some of the issues.
I'm not really sure of the right words to describe what I'm looking for, so possibly this already exists.
I'd like something that is like zipping an iterator with one or more staggered copies of itself. For example, for a window size of 3, on an iterator over
[1, 2, 3, 4, 5]
, this would yield:I wanted this for a machine learning application where I'm trying to predict the next element of a sequence given the previous
N
elements. Perhaps this is also useful for other purposes, but I'm not sure that it is.I have implemented a proof-of-concept. Although the code could be improved in many ways, I think it's correct. If this would be an interesting addition to
itertools
, I'd be happy to refine these implementations to fix some of the issues.The text was updated successfully, but these errors were encountered: