1,151 questions
0 votes
0 answers
41 views
How to calculate rolling regression residuals with missing values?
I'm trying to perform rolling regression on a matrix with missing values and calculate residuals for each row. Specifically, I want to use a rolling window of length 3 where for each window, the ...
0 votes
0 answers
164 views
How to efficiently get the last row of a rolling aggregation group without .last()?
I'm working with a large Polars LazyFrame and computing rolling aggregations grouped by customer (Cusid). I need to find the "front" of the rolling window (last Tts_date) for each group to ...
3 votes
1 answer
68 views
Unexpected behaviour of some Polars rolling functions when NaN's and Nulls are together
I recently came across some behaviour in the way that some of the Polars rolling functions work that I don't understand. The problem seems to only present itself when there is a NaN (np.nan) as well ...
0 votes
0 answers
66 views
In Algotrading, How to Incrementally Calculate Features for New Live Candles, Ensuring Full-Backtest Consistency (Pandas/TA/ML)
I'm developing a live trading bot in Python that fetches OHLCV data (e.g., 15m candles) and computes a large number of features—rolling indicators (VWAP/Volume-ADI,SMA/EMA/ATR/RSI), price action, ...
0 votes
1 answer
49 views
Why is this pandas rolling function exhibiting nonlinear slowdown when run on the cloud?
I moved a library for stock market analysis to the cloud and found strange performance with a key pandas function. It runs reasonably quickly on my low-performance Dell XPS laptop and exhibits ...
2 votes
0 answers
72 views
Why does bottleneck move_mean give different answers for different size arrays but using the same values
This may be similar to bottleneck.move_mean get different result for the same ndarray, but that 'question' was ill-posed and so attracted no answers. I have found that for a single array, bottleneck ...
0 votes
2 answers
75 views
Multiple scrolling text in a label
I need help with this code, My purpose is to show multiple Message one after one, this one is working fine but I need several messages to be shown one after one, I tryied different Method but allways ...
3 votes
2 answers
191 views
Rolling Time Window Average in Polars with Left-Edge Expansion
The goal is to compute a rolling average over 5-minute windows using Polars, where: the window ends at each timestamp t the left edge of the window is not strict — if there are no values exactly at t ...
3 votes
2 answers
85 views
How to filter sequential event data according to whether record is followed by specific event within X minutes?
I have some data with a timestamp column t, an event category column cat, and a user_id column. cat can take n values, including value A. I want to select records which are followed (not necessarily ...
0 votes
2 answers
128 views
Function that calculates rolling MAD while ignoring outlier values [closed]
I am trying to write a function to compute the rolling Median Absolute Deviation (MAD) for outlier detection in a time series dataset. The goal is to: Detect outliers based on a rolling MAD algorithm ...
0 votes
1 answer
98 views
How to do "rolling grouping" in R?
I have a dataset with daily data with the following structure (with many firms and for a very long time frame) in R: date month_id company_id value 2024-01-02 1 1 2 2024-...
2 votes
1 answer
108 views
Create rolling windows with custom overlap
I'd like to analyse time-series data along multiple rolling windows. As a first step, I'd like to extract the start and end-times of said windows. Sadly, using zoo:rollapply seems to be missing a ...
1 vote
1 answer
89 views
Aggregate 3-month rolling dates with overlap [closed]
Suppose I have below dataset: date Value 01-Jul-24 37 01-Aug-24 76 01-Sep-24 25 01-Oct-24 85 01-Nov-24 27 01-Dec-24 28 And I want to aggregate by 3 months rolling:...
2 votes
2 answers
92 views
How to group by on multiple columns and retain the original index in a pandas dataframe?
I need to group by multiple columns on a dataframe and calculate the rolling mean in the group. But the original index needs to be preserved. Simple python code below : data = {'values': [1,2,3,4,5,6,...
1 vote
0 answers
53 views
Unique IDs per 3 month rolling period in SQL
I have an Appointments table with the columns MemberID and DateOfConsultation. Each member may have more than 1 consultation, with the same or different dates. I want to get a rolling 3 month period, ...