I would like to pre definited a condition on itertools combinations.
My problem: I need only combinations with 100 or less days difference.
Actually my code breaks the loop. I would like to cut and continue with the next combinations. Is it possible?
from itertools import combinations
for row in combinations(df.values, 5):
E1_date, E2_date, E3_date, E4_date, E5_date = row[0][0], row[1][0], row[2][0], row[3][0], row[4][0]
if E5_date - E1_date > 100:
break
# The combinations must not have more than 100 days of difference
continueinstead ofbreak?