Use | instead of or . So:
df.loc[(cond1) | (cond2), :]
The or operator wants to compare two booleans (or two expressions that evaluate to True or False). But the series (or the numpy array) does not just evaluate True or False, in which case we want to compare both elements differently. For this you can use | which is called bitwise or.
Pandas follows the conventions here. See here in the pandas docs for an explanation on it.
joris source share