Pandas boolean filtering: Wrap each condition in parentheses

Pandas boolean filtering: Wrap each condition in parentheses

Want to filter a Python Pandas series with two conditions? One option: Combine two boolean series with &.

But careful: Put () around each boolean condition.

s = pd.Series([10, 15, 20, 25, 30])
s.loc[ (s > 20) & (s % 2 == 1) ]  # just 25