So I want to use isin() method with df.query(), to select rows with id in a list: id_list. Similar question was asked bef
isin()
df.query()
id
id_list
This appears to work:
>>> df.query('a == {0}'.format(id_list)) a b c d 0 a a 4 1 1 a a 0 7 2 b a 2 1 3 b a 0 1 4 c b 4 0 5 c b 4 2
Whether or not it is more clear is a matter of personal taste.