I want to produce a simple filter:
fil = (df['col'] == cond 1) | (df['col'] == cond 2) | (df['col'] == cond 3)
however, the number of conditions varies. So in another case, the filter would look like:
fil = (df['col'] == cond 1) | (df['col'] == cond 2)
or
fil = (df['col'] == cond 1) | (df['col'] == cond 2) | (df['col'] == cond 3) | (df['col'] == cond 4)
The conditions themselves are available as a list, i.e.:
condList = [cond 1, cond 2, cond 3]
or
condList = [cond 1, cond 2]
or
condList = [cond 1, cond 2, cond 3, cond 3]
So I would like to have a filter that would somehow look like:
fil = df['col'] == or(condList)