question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Efficient rolling with strides

See original GitHub issue

Xarray is facing the same issues in its current rolling implementation (DataArrayRolling and DatasetRolling) as described in this pandas issue. Namely, the construct methods stride parameter is applied after the rolling is computed. Technically, we are computing more than we would need to because we partially throwing it away due to striding.

In PR #3607 the issue is solved for the ...Rolling’s __iter__ function but not for the construct, reduce and _bottleneck_reduce methods. Since the way Xarray’s rolling is implemented relies on numpy, we could introduce a sliding window function as described here.

Any opinions?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

0reactions
niowniowcommented, Jul 28, 2021

You are right. It’s quite confusing. I’ve already added a stride parameter in my PR #3607 I didn’t follow through with it and at the moment the checks are not successful anymore. Maybe someone else could give an opinion on the pro/cons of a stride parameter in rolling?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced NumPy: Master stride tricks with 25 illustrated ...
While it is an esoteric feature, one particularly practical usage is when sliding windows or rolling statistics are concerned. In this article, we...
Read more >
Pandas rolling regression: alternatives to looping
Is there a method that doesn't involve creating sliding/rolling "blocks" (strides) and running regressions/using linear algebra to get model ...
Read more >
4.7. Implementing an efficient rolling average algorithm with ...
Stride tricks can be useful for local computations on arrays, when the computed value at a given position depends on the neighboring values....
Read more >
Run Faster On Trails With Power Hill Strides
In fact, when Megan started coaching during medical school, I saw that as she gathered more real-world data, she prescribed these efforts far ......
Read more >
Everything You Need to Know About Running Strides
Strides help to improve speed and efficiency without taxing the body's system too much. We then use strides before workouts and races to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found