Can the rolling.Apply support multidimensional?
Now rolling.apply can roll window at one-dimensional,will be able to support multidimensional in the future?Like that:
I find it will be finish in that "https://gist.github.com/seberg/3866040".
Hi @thouger, thanks for the link. My intention is that this library will only support 1D rolling windows, unlike the NumPy example. This is for a couple of reasons:
- I want to be able to support arbitrary iterators (like generators), not just fixed-length containers such as arrays. Adding support for higher dimensions is possible in theory, but very difficult to get right in practice (NumPy's implementation is very impressive).
- My focus for this library is on implementing computationally efficient algorithms over rolling windows and it's not clear to me how some algorithms could be extended to higher dimensions (operations over windows generated using
as_stridedare not efficient as values must be iterated over multiple times to perform the reduction on the window).
Hi @ajcr ,thanks for you answer,The reason that i want to add is because the "rolling" package is very overall package about 1D in pip.Because it can print the iterators result and it's a feature that numpy doesn't have(numpy only provide the result such as max,min when rolling window),so if the rolling package can print n-dimensional result when rolling window that will be even excellent. I will continue to explore the rolling window n-dimensional method.
Thanks @thouger: I'll give your suggestion some more thought. It might be possible to find a solution.