Skip to content

Instantly share code, notes, and snippets.

@janbenetka
Created August 13, 2020 22:51
Show Gist options
  • Save janbenetka/fd7282db973b2afbf0607ec79587a41f to your computer and use it in GitHub Desktop.
Save janbenetka/fd7282db973b2afbf0607ec79587a41f to your computer and use it in GitHub Desktop.
[Query with list comparison ala .isin()] #pandas #query
df.query('a in ["a", "b", "c"]')
id_list = ["a", "b", "c"]
df.query('a in @id_list')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment