3 ms·
Same thing happens in pandas when composing conditionals in a selection operation. You need to use `|` instead of `or`, but its precedence is low so you need to
by andreareina 5y ago
Same thing happens in pandas when composing conditionals in a selection operation. You need to use `|` instead of `or`, but its precedence is low so you need to add parens:
df[(df["col1"] == foo) | (df["col2"] == bar)]