Questions tagged [sliding-window]

In data analysis, sliding windows are advancing sub-lists inside lists which allow, e.g., computation of a record's change from the previous record or next record. In networking, a sliding window may refer to a flow control technique that maintains windows of sequential frames sent or received without a corresponding acknowledgement.

In data analysis, sliding windows are advancing sub-lists inside lists which allow, e.g., computation of a record's change from the previous record or next record. In SQL in particular, the analytic functions LEAD(), LAG(), and computations OVER() a changing subset of query results involve sliding windows.

In networking, a sliding window may refer to a flow control technique that maintains windows of sequential frames sent or received without a corresponding acknowledgement.

583 questions
3
votes
1 answer

sliding window on a python image

I want to transform this matlab code to python: images = []; foreach image in images: features = []; windows = extractWindows(image,size=(30,30),stride=(30,30)); foreach window in windows: featureVector =…
frank97
  • 43
  • 1
  • 3
3
votes
1 answer

How to highlight the regions in a plot to indicate the sliding windows in Python?

I have a time series with extreme events and I tried to get the width of these extreme events using sliding window approach. I used the code: def moving_window(s, length, step =1): streams = it.tee(s, length) return…
Monali
  • 43
  • 7
3
votes
2 answers

Implement sliding window on file lines in Python

I'm trying to implement a sliding/moving window approach on lines of a csv file using Python. Each line can have a column with a binary value yes or no. Basically, I want to rare yes noises. That means if say we have 3 yes lines in a window of 5…
Tina J
  • 4,983
  • 13
  • 59
  • 125
3
votes
1 answer

How to flatten a 3d array of sliding window into 2d array?

I'm using an Autoencoder LSTM in python(Keras). I have a multivariate input and I use a sliding window approach to convert it to the proper format of LSTM input. In the end, I get the output with the same shape as the window. Then I want to convert…
zahra
  • 97
  • 2
  • 10
3
votes
1 answer

Is there a function in python to detect singular points on a curve?

I need to detect singular points (extremas, trend change, sharp changes) on a given curve plotted from a dataset. The first thing to come in mind is the inflexion point detection with derivation( but i dont have the mathematical expression of the…
skull95
  • 33
  • 3
3
votes
5 answers

Is there a fast R function like rollapplyr with increasing window size?

I want to calculate a sum over a sliding window on grouped data. As I would like to stick to official functions if possible I started with rollapplyr like this: library(tidyverse) library(reshape2) library(zoo) data =…
Stephan Claus
  • 405
  • 1
  • 6
  • 16
3
votes
1 answer

algorithm about sliding window

This question is a variant of k empty slot from leetcode. the new question is, ask to find the last day when there are k consecutive bloomed flowers. e.g. total 7 days, 1 represents flower bloomed,0 represents flower not bloomed, k=3 day1:1 0 0 0 0…
Tianbo
  • 67
  • 2
  • 11
3
votes
1 answer

How to put an "arbitrary" operation into a sliding window using Theano?

I want to define some function on a matrix X. For example mean(pow(X - X0, 2)), where X0 is another matrix (X0 is fixed / constant). To make it more specific, let's assume that both X and X0 are 10 x 10 matrices. The result of the operation is a…
Roman
  • 124,451
  • 167
  • 349
  • 456
3
votes
2 answers

Pandas Sliding/Rolling Window over Irregular Time Series

Please excuse poor style and inefficient solutions. All help is greatly appreciated. Context: Attempting to isolate the best rate of cycling performance gain over a 6-week block over the course of one year. Performance is measured as the maximum…
Rudabagle
  • 39
  • 7
3
votes
1 answer

Neo4j: Check condition between all consecutive relations in path

I want to query all paths of arbitrary length (a)-[:Relation*]->(b) where for each pair (r1, r2) of consecutive relationships ()-[r1]->()-[r2]->() a condition, say r2.foo > r1.foo, is met. You can imagine foo being a timestamp and I only want to…
Kirill Rakhman
  • 42,195
  • 18
  • 124
  • 148
3
votes
3 answers

R: Window function

I have a data frame DF, with three columns and n rows shown below: Month Year Default 1 2015 T 2 2015 T 3 2015 F 4 2015 T 5 2015 T 6 2015 T 7 2015 F I would like to check if there are 3 T in a roll and keep going…
3
votes
2 answers

Sliding Window: Implementation and Performance (Java)

I want to implement a very simple sliding window. In other words, I will have some kind of list with objects inserted from the right end of that list and dropped from the left end. In every insertion, the previous objects are left-shifted by one…
3
votes
1 answer

sql sliding window - finding max value over interval

i have a sliding window problem. specifically, i do not know where my window should start and where it should end. i do know the size of my interval/window. i need to find the start/end of the window that delivers the best (or worst, depending on…
jasonmclose
  • 1,667
  • 4
  • 22
  • 38
3
votes
3 answers

csv.reader only reading in one line

I am pretty new to python. I am trying to process data on a very large .csv file (~6.8 million lines). An example of the lines would look like: Group1.1 57645 0.0954454545 Group1.1 57662 0.09556544778 Group1.13 500 0.357114538…
abovezero
  • 63
  • 2
  • 11
3
votes
1 answer

Flexible sliding window (in Python)

Problem description: I'm interested in looking at terms in the text window of, say, 3 words to the left and 3 to the right. The base case has the form of w-3 w-2 w-1 term w+1 w+2 w+3. I want to implement a sliding window over my text with which I…
sim
  • 992
  • 1
  • 7
  • 12