import pandas as pd
data = {'time': ['09:30:00',
'09:31:00',
'09:37:00',
'09:38:00',
'09:39:00',
'09:40:00',
'09:46:00',
'09:47:00',
'09:48:00'],
'sum': [5, 8, 5, 10, 15, 2, 0, 0, 0]}
my_index = pd.MultiIndex.from_arrays([["A"]*6 + ["B"]*3, [1, 1, 1, 2, 2, 2, 1, 1, 1]], names=["ID-A", "ID-B"])
df = pd.DataFrame(data, index=my_index)
If I do resampling for every 3 minutes with sum(),i.e.->
data=data.set_index('time').groupby(['ID-A','ID-B']).resample('3min').sum()
There is a window({9:33 - 9:36},{9:42 - 9:45}) for which the sum() comes out to be 0. There are some values in my dataframe which actually evaluate to 0 even after the time windows are available for it(9:45-9:48). I do not want resampling for time windows where there is no data available.
I want to find out windows where my sum is 0 but due to resampling I am getting fake 0s in my data as there are no data available for those time.