pythonwindowoverlappooling

Calculate minimum of overlapping window


I am having trouble with thinking of a way to solve a problem. I have a dataframe like the one below:

enter image description here

These are values for overlapping windows. My challenge is to calculate the minimum value when pooling(?) the windows. It should look like:

enter image description here

I am a bit lost here on what direction to take, does anyone have any suggestions?


Solution

  • Assuming that you are looking to define windows that do not overlap with the value of the minimum if the new window is the intersection of two old windows, we need to solve this issue by doing two things.

    OUTPUT

              Start End value
           0    0   5   0.1
           1    5   10  0.1
           2    10  15  0.2
           3    15  20  0.2
           4    20  25  0.4
           5    25  30  0.3
           6    30  35  0.3
    

    if you need a more detail explanation of what each line/function is doing, please feel free to ask for more details, i'll update the answer.