
My favorite way to apply multiple filters to a Python Pandas series? Method chaining calling loc 2x:
s = pd.Series([10, 15, 20, 25, 30])
(
s
.loc[ (s > 20)] # filters s
.loc[ (s % 2 == 1) ] # filters line 1
)
But: This can break! Tomorrow, a better way.
