I have three Series
trans = pd.Series([2020-01-01, 2022-03-15 ...]) #transaction
start = pd.Series([2020-02-03, 2021-05-13]) #valid dates start
end =pd.Series([2020-02-28,2021-06-13]) #valid dates end
and I want to see if a transaction is "valid" which it is, if it was made in a date-range defined by start and end i.e start[i] and end[i] composes one date-range of which the transaction could be valid, e.g for the first transaction, I want to check if 2020-01-01 is between (2020-02-03,2020-02-28) or (2021-05-13,2021-06-13).
I have tried using between e.g trans.between(start,end) but since trans is not the same size, it cannot be done in that way.
I have written a list comprehension but it loops through all start,end pairs for each element in trans, which is not optimal, since it should terminate when it just finds one pair.
I can remove some of the transactions by checking, if the date is above min(start) and below max(end), but it still takes a while by my own solution