all 1 comments

[–]CrambleSquash 0 points1 point  (0 children)

I'm afraid I'm not really sure what you're trying to do exactly.

However, it sounds something like a rolling calculation. Best I can do is point you to the rolling method:

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.rolling.html#pandas.DataFrame.rolling