Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)]


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: