Python Forum
Pandas .rolling() with some calculations inside
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pandas .rolling() with some calculations inside
#4
Are you telling about applying a rolling window of variable width? If so, Pandas doesn't support such windows, except ones based on datetime-like columns. You can try to 1) write all logic in a for loop, e.g. usingdf.iterrows(); 2) Use Cython, df.values is numpy array, Cython supports numpy arrays; (that would be most efficient) 3) make some magic and turn you condition on selecting window size into datetime-like column and apply pandas rolling window (I am not sure if this possible);
Reply


Messages In This Thread
RE: Pandas .rolling() with some calculations inside - by scidam - Mar-29-2019, 03:18 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Evaluate Calculations yrstruly 0 1,103 Jun-17-2023, 06:51 PM
Last Post: yrstruly
  pandas df inside a df question mbaker_wv 4 1,235 Dec-25-2022, 01:11 AM
Last Post: mbaker_wv
  Rolling window and apply code JunkBoy 6 1,954 Jul-23-2022, 07:00 PM
Last Post: JunkBoy
  Hurst Exponent in Rolling Basis illmattic 1 3,918 Jan-06-2021, 09:49 PM
Last Post: illmattic
  Calculating Beta over Rolling Periods illmattic 2 5,509 Sep-27-2020, 11:27 PM
Last Post: Larz60+
  What to use with simple calculations Milfredo 6 2,737 Sep-24-2020, 06:42 AM
Last Post: Milfredo
  Apply rolling window function over time dimension of 3D data Staph 0 2,223 Jan-01-2020, 08:31 AM
Last Post: Staph
  huge and weird values after applying some calculations karlito 2 2,200 Dec-13-2019, 08:32 AM
Last Post: karlito
  Grouping data based on rolling conditions kapilan15 0 1,986 Jun-05-2019, 01:07 PM
Last Post: kapilan15
  How to use pandas.rolling mean for 3D input array? Prv_Yadv 1 3,899 Mar-26-2019, 11:49 AM
Last Post: scidam

Forum Jump:

User Panel Messages

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