Python Forum
What data structure I need
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What data structure I need
#2
I am not sure I can completely understand all your questions, but since you are talking about data frames, I suspect that you are using Pandas package.

Pandas supports rolling windows. It could be applied to DataFrame and Series instances. Why do you need to pick windowed data up?
As far as I undertood you correctly, you are trying to do something like this (but with data frames):

Quote:[1, 2, 3, 4, 5] => applying rolling window of size 3 => [[1, 2, 3], [2, 3, 4], [3, 4, 5]]

Note, you usually don't need to store right side of rolling operation. Usually, rolling window is applyied to
obtain, e.g., moving average values. In pandas this could be easily done using .rolling method: df.rolling(3).mean()
df.rolling(3).sum(), or if df has time-based index, df.rolling('3s').mean().
Reply


Messages In This Thread
What data structure I need - by dervast - Apr-04-2019, 05:22 PM
RE: What data structure I need - by scidam - Apr-06-2019, 10:56 AM
RE: What data structure I need - by dervast - Apr-06-2019, 03:45 PM
RE: What data structure I need - by scidam - Apr-07-2019, 11:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Data structure question standenman 1 675 Jun-04-2023, 11:51 AM
Last Post: jefsummers
  Is there a better data structure than classes for a set of employes? Schlangenversteher 5 2,657 Feb-26-2020, 11:43 AM
Last Post: buran
  Data saving structure JosefFilosopio 0 2,145 May-04-2019, 10:48 AM
Last Post: JosefFilosopio
  Replacing values for specific columns in Panda data structure Padowan 1 14,700 Nov-27-2017, 08:21 PM
Last Post: Padowan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020