I have a dataframe which has timestamps as indexes. In order to do the data analysis I had to "break" in pieces the dataframe. So now I have a lot of dataframes with different time periods, for example:
This is one part of the first dataframe:
This is another part with different time period:
I want to calculate the rolling().mean() in the time period of each dataframe, so in order to do that, I have to set as an offset, a variable that is equal with the time period of each dataframe. For example: df=df.rolling('t').mean() Where t is 12s for the dataframe in image 1 and 10s in image 2. I tried to do it like this but I get the error: passed window is not compatible with a datetimelike index. So how can I change that, is it another way I can do it?

