groupby with overlapping intervals timeseries

I have a time series in python pandas dataframe object and I want to create a group based on index but I want overlapping groups i.e groups are not distinct. The header_sec is the index column.
Each groups consists of a 2 second window.
Input dataFrame