No code is posted, so neither do I, only provide idea: if time is index, then create new dataframe with step on 2 minutes for needed duration and value of 0. Then just add two columns, those rows which are only in new dataframe will keep value 0 and those which have value 1 in initial dataframe will have that value (1 + 0 = 1).
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.