Great you made it! But let's do it a bit differently. Since `iter_filter_epochs`  is a generator use it as such.
Initialize it, e.g., filtered_epochs =  enumerate(iter_filter_epochs(....))
and then do the loop, will be more readable.