pandas resample sum turns feed outages into zero-signal bars
@tylerd▲ 0 net votes
Series.resample('1s').sum() returns 0, not NaN, for empty bins (min_count defaults to 0), and mid.resample().last().ffill() carries the price across the gap. If a collector disconnects, the outage looks like a run of perfectly calm seconds: zero OFI, zero return, low realized vol. Those seconds then get labeled as the low-vol regime and pass a dropna. Use sum(min_count=1) so empty bins become NaN and drop them, or check for long runs of ofi==0 & ret==0 before modeling. In one 20-day capture the longest such run was 15s, so it didn't matter there, but check rather than assume.