-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Move sliding_window_view
to the main module and add step_size
#18244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I argued against step_size when we designed this function, because you can get that behavior |
Yes, I would also like to see My use case also needs a step size, but as @eric-wieser suggested, I have achieved that with slicing. This shouldn't be more expensive, since the result is a view on the array already. Shall I make a PR for this? Edit: And if so, should it be exposed in |
Note that this was deliberately moved out of the main namespace in #17720, in response to a comment by @rgommers
and further down the same thread:
|
Ah apologies in that case, I didn't know that. No plans to completely remove this feature hopefully 😅 ? |
A reorganization of the
No, we just added it in the most recent release. |
Hi @rgommers, I’m curious to know if there has been any development regarding the mentioned reorganization? I find myself keep going back to how to implement a sliding window properly, and numpy’s seems to mostly satisfy my needs, I say mostly since it’s location is annoying to remember and the function name is too long, if possible I would suggest renaming it to ‘window’. |
gh-18447 made some initial steps, but it seems to have stalled.
That's way too generic a name; even in numpy itself we have other "window functions" like |
np.lib.stride_tricks.sliding_window_view
is a bit of a mouthful, I think it would be better if it was placed inside the main module. (also doingimport from
is a bit inconvenient)step_size
parameter to the function, an example of its use would be:The text was updated successfully, but these errors were encountered: