I have two pandas data frame of the following kind. The first is df1
A B C D <- columns name
1 2 0 0
1 2 0 1
1 2 3 0
4 5 6 2
4 5 1 2
4 5 0 1
2 3 1 0
5 7 8 0
the second is df2
A B C D <- columns name
1 2 0 1
4 5 0 1
I want to create a new dataframe by selecting from df1 all the rows whose entries in columns A,B are in df2. For example, the result should be a df3 in the following way
A B C D <- columns name
1 2 0 0
1 2 0 1
1 2 3 0
4 5 6 2
4 5 1 2
4 5 0 1
How can I do it efficiently in pandas?