rolling icon indicating copy to clipboard operation
rolling copied to clipboard

Can the rolling.Apply support multidimensional?

Open thouger opened this issue 7 years ago • 3 comments

Now rolling.apply can roll window at one-dimensional,will be able to support multidimensional in the future?Like that: image I find it will be finish in that "https://gist.github.com/seberg/3866040".

thouger avatar Oct 09 '18 03:10 thouger

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_strided are not efficient as values must be iterated over multiple times to perform the reduction on the window).

ajcr avatar Oct 14 '18 10:10 ajcr

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.

thouger avatar Oct 15 '18 04:10 thouger

Thanks @thouger: I'll give your suggestion some more thought. It might be possible to find a solution.

ajcr avatar Oct 15 '18 21:10 ajcr