I have a dataframe like:
+--------+-------+--------------------+-------------------+
| id1| id2| body| created_at|
+--------+-------+--------------------+-------------------+
|1 | 4|....................|2017-10-01 00:00:05|
|2 | 3|....................|2017-10-01 00:00:05|
|3 | 2|....................|2017-10-01 00:00:05|
|4 | 1|....................|2017-10-01 00:00:05|
+--------+-------+--------------------+-------------------+
I would like to filter the table using both id1 and id2. For example get rows where id1=1, id2=4 and id1=2, id2=3.
Currently, I'm using loop to generate a giant query string for df.filter(), i.e. ((id1 = 1) and (id2 = 4)) or ((id1 = 2) and (id2 = 3)). Just wondering if there is a more properly way to achieve this?