[Numpy-discussion] Add sliding_window_view method to numpy

Zimmermann Klaus klaus.zimmermann at smhi.se
Mon Oct 12 04:39:03 EDT 2020


Hello,

I would like to draw the attention of this list to PR #17394 [1] that
adds the implementation of a sliding window view to numpy.

Having a sliding window view in numpy is a longstanding open issue (cf
#7753 [2] from 2016). A brief summary of the discussions surrounding it
can be found in the description of the PR.

This PR implements a sliding window view based on stride tricks.
Following the discussion in issue #7753, a first implementation was
provided by Fanjin Zeng in PR #10771. After some discussion, that PR
stalled and I picked up the issue in the present PR #17394. It is based
on the first implementation, but follows the changed API as suggested by
Eric Wieser.

Code reviews have been provided by Bas van Beek, Stephen Hoyer, and Eric
Wieser. Sebastian Berg added the "62 - Python API" label.


Do you think this is suitable for inclusion in numpy?

Do you consider the PR ready?

Do you have suggestions or requests?


Thanks for your time and consideration!
Klaus


[1] https://github.com/numpy/numpy/pull/17394
[2] https://github.com/numpy/numpy/issues/7753


More information about the NumPy-Discussion mailing list